问题
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