How do i make shared libs extracted by Android for AAB?

二次信任 提交于 2021-01-07 06:34:55

问题


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.

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

and i can see shared libs in apk.

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

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

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


回答1:


Sorry for the duplicate.

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



来源:https://stackoverflow.com/questions/65011941/how-do-i-make-shared-libs-extracted-by-android-for-aab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!