Android12 内置应用问题 mismatch in the <uses-library> tags between the build system and the manifest

简介: Android12 内置应用问题 mismatch in the <uses-library> tags between the build system and the manifest
FAILED: out/target/common/obj/APPS/MyEmail_intermediates/enforce_uses_libraries.status
/bin/bash -c "(rm -f out/target/common/obj/APPS/MyEmail_intermediates/enforce_uses_libraries.status ) && (build/soong/scripts/manifest_check.py           --enforce-uses-libraries        --enforce-uses-libraries-status out/target/common/obj/APPS/MyEmail_intermediates/enforce_uses_libraries.status          --aapt out/host/linux-x86/bin/aapt                                      vendor/rockchip/common/apps/GoogleEmail/MyEmail.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, androidx.window.extensions, androidx.window.sidecar]
        - tags in the manifest (vendor/rockchip/common/apps/GoogleEmail/MyEmail.apk):
                uses-library-not-required:'org.apache.http.legacy'              uses-library-not-required:'androidx.window.extensions'          uses-library-not-required:'androidx.window.sidecar'
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

解决办法:

第一种:忽略检查

LOCAL_ENFORCE_USES_LIBRARIES := false

第二种:指明使用的库,应用申明的都要写,中间用空格隔开

LOCAL_OPTIONAL_USES_LIBRARIES := org.apache.http.legacy androidx.window.extensions

FAQ:

关于APP <uses-library>的使用情况查看:使用aapt 工具,可以查看到使用情况

aapt dump badging  xxx.apk

<application
      ........
  ........>
      <uses-library
          android:name="。。。。。。。"
          android:required="true" />
</application>

require设置为true uses-library将会包含对应的库


require设置为false uses-library-not-required将会包含对应的库


说明:


这个元素用于指定该应用程序必须链接的共享类库。这个元素告诉系统该应用程序包的类装载器中所包含的类库代码。


Android的所有包(如andorid.app,android.content,android.view和android.widget等)都在应用程序自动链接的默认类库中。但是,有些包是在于独立的类库中,它们不能被自动的链接到应用程序包中,要查看这些包的文档,以确定要把哪些类库包含到包的代码中。


这个元素也会影响该应用程序在特殊设备上的安装,以及应用程序在Google Play上的可用性。


安装:


如果在该应用的清单中出现这个元素,并且它的android:required属性被设置为true,那么除非该类库在用户的设备上存在,否则PackageManager框架不会让用户安装这个应用程序。


属性:


android:name

这个属性用于指定类库的名称。这个名称是在对应的类库文档中提供的。例如:android.test.runner库就是包含Android测试类的一个程序包。


android:required

(默认值是true。这个属性在API Level 7中被引入)


这个属性用于指定应用程序是否需要有android:name属性所指定的类库:


true:没有这个库应用程序无法工作。如果用户设备设备上没有这个类库,系统不允许该应用程序安装在这个设备上。


false:如果该类库存在,则应用程序能够使用这个类库,但是如果有必要,也可以设计成没有该类库,应用程序也能够工作。系统会允许应用程序安装,即使该类库不存在。如果使用false,就要在运行时对类库的有效性进行必要的检查。对于类库的检查,可以使用反射机制来判断一个具体的类是否有效。

 


目录
相关文章
|
4天前
|
安全 Java Shell
Android发送广播时报错:Sending non-protected broadcast xxxxxxx from system xxxxxxxxxx
Android发送广播时报错:Sending non-protected broadcast xxxxxxx from system xxxxxxxxxx
26 0
|
2天前
|
Java 测试技术 开发工具
Android 笔记:AndroidTrain , Lint , build(1),只需一篇文章吃透Android多线程技术
Android 笔记:AndroidTrain , Lint , build(1),只需一篇文章吃透Android多线程技术
|
4天前
|
Shell 开发工具 Android开发
如何单独 build android ap (以launcher为例)
如何单独 build android ap (以launcher为例)
10 1
|
4天前
|
Android开发
Android修改默认system/bin/下可执行程序拥有者和权限,使用实例,只有root和系统app权限才能执行某个命令。
Android修改默认system/bin/下可执行程序拥有者和权限,使用实例,只有root和系统app权限才能执行某个命令。 【5月更文挑战第2天】
19 0
|
4天前
|
编译器 Android开发
Android S内置APK时AndroidManifest使用uses-library编译报错
Android S内置APK时AndroidManifest使用uses-library编译报错
13 0
|
12月前
|
Android开发
Android关于Manifest清单文件name报错
在清单文件的根目录加上package 里面的是你的包名 activity的name,前面有个点是接上了你的package名,省略了包名,不然 com.yyt.accountbooks.activity.LoginActivity这样就是不简写的。
63 0
|
缓存 Android开发
Timeout waiting to lock daemon addresses registry. Android Build失败(Bug5)
Timeout waiting to lock daemon addresses registry. Android Build失败(Bug5)
|
Android开发
Android Studio的Project有某个项目,Build Variants却没有,如何添加物已有项目?
Android Studio的Project有某个项目,Build Variants却没有,如何添加物已有项目?
118 0
|
存储 XML Java
Android清单文件详解(一) ---- 一切从<manifest>开始
Android清单文件详解(一) ---- 一切从<manifest>开始
381 0
Android清单文件详解(一) ---- 一切从<manifest>开始