gpt4 book ai didi

jar - 将预构建的 jar 添加到 AOSP

转载 作者:行者123 更新时间:2023-12-04 12:52:46 29 4
gpt4 key购买 nike

我正在尝试在编译 AOSP 时向 Android 添加一个预构建的 jar。
jar 的名称是“nxpnfclib.jar”,我将它放在 AOSP/prebuilts/misc/common/nxp。我也写了一个Android.mk:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_PREBUILT_JAVA_LIBRARIES := \
nxpnfclib$(COMMON_JAVA_PACKAGE_SUFFIX)

LOCAL_MODULE_TAGS := optional

include $(BUILD_HOST_PREBUILT)

我想在 AOSP/packages/apps/Settings 中使用这个 jar,所以我将 nxpnfclib 添加到 AOSP/packages/apps/Settings/Android.mk
LOCAL_STATIC_JAVA_LIBRARIES := guava android-support-v4 jsr305 nxpnfclib

但是,当我编译整个 AOSP 时,会出现一些错误:

Warning: class [com/nxp/nfclib/ntag/╦К.class] unexpectedly contains class [com.nxp.nfclib.ntag.ˊ] Warning: there were 30 classes in incorrectly named files. You should make sure all file names correspond to their class names. The directory hierarchies must correspond to the package hierarchies. If you don't mind the mentioned classes not being written out, you could try your luck using the '-ignorewarnings' option. Error: Please correct the above warnings first. make: *** [out/target/common/obj/APPS/Settings_intermediates/proguard.classes.jar] Error 1



我该如何解决这个错误?它可能来自 proguard。

有没有其他方法可以添加 jar ?

最佳答案

在 src 中再创建一个目录 libs 并将 jar 文件放入其中。然后将这几行添加到 Android.mk 文件中

LOCAL_STATIC_JAVA_LIBRARIES += nxpnfclib
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:=nxpnfclib:src/libs/nxpnfclib.jar
include $(BUILD_MULTI_PREBUILT)

关于jar - 将预构建的 jar 添加到 AOSP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36745754/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com