android apk应用系统集成编译错误问题

在系统源码中添加一个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信息处理






郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。