Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> android apk應用系統集成編譯錯誤問題

android apk應用系統集成編譯錯誤問題

編輯:關於Android編程

在系統源碼中添加一個APK源碼目錄,並寫了相應的android.mk文件,編譯時出錯如下:

make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/liba71S_intermediates/javalib.jar', needed by `out/target/common/obj/APPS/My_Settings_intermediates/classes-full-debug.jar'. Stop.
make: *** Waiting for unfinished jobs....

按之前的經驗,嘗試了幾種方法,發現都沒有解決,後來定位到android.mk文件寫的有問題

修改前:

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_JAVA_LIBRARIES := bouncycastle telephony-common
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 testinterface

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := My_Settings
LOCAL_CERTIFICATE := platform

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :android-support-v4:libs/android-support-v4.jar testinterface:libs/testinterface.jar

include $(BUILD_PACKAGE)

# Use the folloing include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

上述編譯會出錯,


修改後,編譯oK

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_JAVA_LIBRARIES := bouncycastle telephony-common
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 testinterface

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := My_Settings
LOCAL_CERTIFICATE := platform

include $(BUILD_PACKAGE)

include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :android-support-v4:libs/android-support-v4.jar testinterface:libs/testinterface.jar
include $(BUILD_MULTI_PREBUILT)

# Use the folloing include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

其他說明:

1.要使用mm命令單獨編譯某個模塊或者應用,首先需要在JB目錄下全部編譯一次。

如果斷開編譯服務器(如關機後第二天再次需要單獨編譯)後,想再次單獨編譯,只需要配置項目環境,當然前提是你之前編譯過一次,並且沒有clean過。配置項目編譯環境命令:1. source build/envsetup.sh 2. lunch project_number

2.如果你的模塊或者應用的android.mk裡面配置LOCAL_MODULE_TAGS := optional ,則需要把LOCAL_PACKAGE_NAME 對應的名字添加到系統的PRODUCT_PACKAGES +=中,如PRODUCT_PACKAGES +=My_Setting \

3.其他具體編譯錯誤,再根據具體的log信息處理





  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved