如何制作Android提取的AAB共享库

如何制作Android提取的AAB共享库

本文介绍了如何制作Android提取的AAB共享库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 android:extractNativeLibs ="true" 设置为Android 29,并将共享库提取到/data/app/%package%/... 通过Android.如果使用APK可以正常运行,请执行解决方法Android 10权限问题.

I set android:extractNativeLibs="true" and target to Android 29 to make my shared libs extracted to /data/app/%package%/... by Android. If works just fine with APK to workaround Android 10 permissions issue.

最近,由于下载大小增加到150Mb,我不得不切换到 AAB 我的APK大小超过了Google Play 100Mb的限制.当从AAB测试APK安装时[来自应用捆绑包的APK"我注意到/data/app/%package%/.. 是空的(与纯粹的单个APK安装相反),这是我遇到的一个问题需要它们能够作为可执行文件执行(请​​参阅解决方法中的详细信息).我已经检查了构建目录中的拆分apk,其中包含适用于我的测试设备的正确设置:

Recently i had to switch to AAB due to increased to 150Mb download size as my APK size exceeds Google Play limit of 100Mb. When testing APK installation from AAB ["APK from app bundle" deploy option in Android Studio] i noticed /data/app/%package%/.. is empty (in contrast to pure single APK installation) which is a problem as i need them to be able to be executed as executables (see the details in workaround). I've checked split apks in build dir and they contain the right set for my test device:

/out/base-arm64_v8a_2.apk
/out/base-ru.apk
/out/base-master_2.apk
/out/base-xxhdpi.apk

我可以在apk中看到共享库.

and i can see shared libs in apk.

但是对于AAB,忽略 android:extractNativeLibs ="true" .

However android:extractNativeLibs="true" is ignored for AAB.

是错误还是功能?我怎么能甚至为AAB强制提取库?

Is it a bug or a feature? How can i force extract the libs even for AAB?

PS.在gradle.properties中使用Gradle插件5.6和 android.enableAapt2 = true .尝试了Release和Debug版本.

PS. Using Gradle plugin 5.6 and android.enableAapt2=true in gradle.properties. Tried both Release and Debug variants.

推荐答案

重复.

简而言之:只需在"gradle.properties"中使用 android.bundle.enableUncompressedNativeLibs = false .

In brief: just use android.bundle.enableUncompressedNativeLibs=false in your "gradle.properties".

这篇关于如何制作Android提取的AAB共享库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 07:54