android apk應用系統整合編譯錯誤問題

來源:互聯網
上載者:User

在系統源碼中添加一個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資訊處理






聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.