3

我正在添加一个应用程序作为我的 android 构建的一部分。该应用程序使用 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

有人可以让我知道需要做什么,这样我就可以摆脱这个错误并让我的构建正常工作

更新

我完整的 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)
4

1 回答 1

1
LOCAL_STATIC_JAVA_LIBRARIES := \
        android-support-v4

这应该有效。放在前面的任何地方include $(BUILD_PACKAGE)

于 2013-03-11T10:13:16.200 回答