我正在添加一个应用程序作为我的Android构build的一部分。 该应用程序使用android-support-v4.jar。 所以我把jar文件放在我的应用程序的libs文件夹中,并从应用程序的Android.mk文件中引用它,如图所示。
include $(BUILD_PACKAGE) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libs/android-support-v4.jar include $(BUILD_MULTI_PREBUILT)
在编译源代码时,出现以下错误:
build/core/base_rules.mk:170: *** packages/apps/Personalization: MODULE.TARGET.JAVA_LIBRARIES.android-support-v4 already defined by frameworks/support/v4. Stop. DDK build start. error: build_android build/core/base_rules.mk:170: *** packages/apps/Personalization: MODULE.TARGET.JAVA_LIBRARIES.android-support-v4 already defined by frameworks/support/v4. Stop. DDK build start. error: build_android
有人可以让我知道需要做什么,这样我可以摆脱这个错误,让我的构build工作正常
UPDATE
我完整的Android.mk文件
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_STATIC_JAVA_LIBRARIES := \ android-support-v4 \ LOCAL_PACKAGE_NAME := Personalization LOCAL_CERTIFICATE := platform include $(BUILD_PACKAGE) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libs/android-support-v4.jar include $(BUILD_MULTI_PREBUILT)
LOCAL_STATIC_JAVA_LIBRARIES := \ android-support-v4
这应该工作。 把它放在任何地方, include $(BUILD_PACKAGE)