2

I'm trying to release an app on the Playstore that includes .so lib files. When I try to debug it, the app works fine. But when I try to release it and upload it on the PlayStore via .aab and install it, my app can't find the .so file that I put in the Jnilibs folder. It says

.so file Not Found

I tried many solutions (ndk, abifilters, split, etc.) but nothing worked. I'm using Android Studio arctic fox 2020.3.1 version.

Laurel
  • 5,965
  • 14
  • 31
  • 57
unboundExDev
  • 23
  • 1
  • 4
  • Please read: [Why is “Can someone help me?” not an actual question?](https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question) – Turing85 Dec 25 '21 at 09:53
  • I've gone in details to explain why that happens and how to fix it here: https://stackoverflow.com/a/56551499/4265103 – Pierre Dec 26 '21 at 15:05

2 Answers2

11

The option setting 'android.bundle.enableUncompressedNativeLibs=false' is deprecated. The current default is 'true'. It will be removed in version 8.0 of the Android Gradle plugin. You can add the following to your build.gradle instead:

android {
    packagingOptions {
        jniLibs {
            useLegacyPackaging = true
        }
    }
}
Blue Ocean
  • 208
  • 2
  • 8
0

Finally I found the solution:

Just Put this code in your gradle.properties

android.bundle.enableUncompressedNativeLibs=false

And problem solved all lib that you input in jnilibs will be included once your app has been live in PlayStore and installed by the users :)

hiddeneyes02
  • 2,562
  • 1
  • 31
  • 58
unboundExDev
  • 23
  • 1
  • 4
  • Note that although this works, this makes your app bigger for most of your users. You may want to tweak how you load your .so file so that the Android platform finds it. It's not missing, it's just not extracted from the APK at installation time so the platform has to read it from inside the APK directly. See https://stackoverflow.com/a/56551499/4265103 – Pierre Dec 26 '21 at 15:04