1

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.

4ntoine
  • 19,816
  • 21
  • 96
  • 220
  • Out of curiosity, would you be able to explain why you need the libraries extracted? I would like to understand the use-cases. – Pierre Nov 26 '20 at 09:49
  • As it's mentioned in workaround link they are executables essentially. The use case is just to reuse existing functionality of 3rd-party sdks/toolchains (think of GCC used on Android for simplicity). It's absolutely unrealistic to reimplement it in Java/Kotlin and highly undesired to make shared libs of the executables. It feels very confusing to strict the requirements and prevent devs from being able to run the executables in app dir. – 4ntoine Nov 26 '20 at 10:45

1 Answers1

0

Sorry for the duplicate.

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

4ntoine
  • 19,816
  • 21
  • 96
  • 220
  • 1
    I have the same issue. Everything works in test environment (aab is working too) but when I upload to Play and install app from there - the app crashes due to the lib folder is empty. did you experience such issue? – vadim_hr Mar 13 '21 at 09:47
  • @vadim_hr Hi how did you solve your problem? thanks – ch271828n Mar 24 '22 at 13:09