Android 12 内置APK mismatch in the <uses-library> tags

 Android系统源码开发系列教学视频链接:

Android 10.0 AOSP源码编译:

        AOSP源码开发环境搭建教学视频-百问100ask   

       Android系统 10.0 AOSP源码编译--CSDN程序员研修院

 Android 10.0 根文件系统和编译系统:

        Android根文件系统和编译系统教学视频-百问100ask

        Android 10.0 根文件系统和编译系统-CSDN程序员研修院


前言

   在Android 12源码升级适配是, 需要内置各种第三方APK, 如搜狗输入法, FIrefox等,使用Android9上的Android.mk进行编译, 发现会报错。


出错信息

FAILED: out/target/common/obj/APPS/SogouInputMi_intermediates/enforce_uses_libraries.status
/bin/bash -c "(rm -f out/target/common/obj/APPS/SogouInputMi_intermediates/enforce_uses_libraries.status ) && (build/soong/scripts/manifest_check.py         --enforce-uses-libraries        --enforce-uses-libraries-status out/target/common/obj/APPS/SogouInputMi_intermediates/enforce_uses_libraries.status        --aapt out/host/linux-x86/bin/aapt                                 device/rochchip/rk3399/common/apps/SogouInput_xiaomi/SogouInputMi.apk )"
error: mismatch in the <uses-library> tags between the build system and the manifest:
        - required libraries in build system: []
                         vs. in the manifest: []
        - optional libraries in build system: []
                         vs. in the manifest: [org.apache.http.legacy]
        - tags in the manifest (device/rochchip/rk3399/common/apps/SogouInput_xiaomi/SogouInputMi.apk):
                uses-library-not-required:'org.apache.http.legacy'
note: the following options are available:
        - to temporarily disable the check on command line, rebuild with RELAX_USES_LIBRARY_CHECK=true (this will set compiler filter "verify" and disable AOT-compilation in dexpreopt)
        - to temporarily disable the check for the whole product, set PRODUCT_BROKEN_VERIFY_USES_LIBRARIES := true in the product makefiles
        - to fix the check, make build system properties coherent with the manifest
        - see build/make/Changes.md for details

解决方法

修改Android.mk,添加LOCAL_ENFORCE_USES_LIBRARIES := false,

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := APPS


LOCAL_MODULE := SogouInputMi
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_PREBUILT_JNI_LIBS := $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/lib/arm64-v8a/*.so))

LOCAL_PRIVILEGED_MODULE := true
LOCAL_OVERRIDES_PACKAGES := LatinIME
LOCAL_CERTIFICATE := PRESIGNED
#LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE)

LOCAL_ENFORCE_USES_LIBRARIES := false

include $(BUILD_PREBUILT)
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

旗浩QH

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值