Android系统源码开发系列教学视频链接:
Android 10.0 AOSP源码编译:
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)