Status Update
Comments
rm...@google.com <rm...@google.com> #2
uc...@google.com <uc...@google.com>
je...@google.com <je...@google.com>
le...@google.com <le...@google.com>
le...@google.com <le...@google.com> #3
ab...@google.com <ab...@google.com>
le...@google.com <le...@google.com>
le...@google.com <le...@google.com> #4
ASEC storage has been deprecated several years ago and installs are banned since Android O (8.0), so I suspect that the exceptions you see on version 8.0+ are unrelated. Could you please check that the exceptions on devices on 8.0+ have indeed different stacktraces?
To mitigate this issue, bundletool could leave the native libraries compressed in the APKs on O+ whenever installLocation is set to "auto" or "preferExternal".
je...@gmail.com <je...@gmail.com> #5
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.lds.ldssa-Ms3Se_bJEm53xgnoNTHnxg==/base.apk"],nativeLibraryDirectories=[/data/app/org.lds.ldssa-Ms3Se_bJEm53xgnoNTHnxg==/lib/arm, /system/lib, /vendor/lib]]] couldn't find "libsqliteX.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
....
Here is another one for a Android 8.1.0 on device LM-V405
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.lds.ldssa-v8dzvQ_3IHJacrVlTX6c5A==/base.apk"],nativeLibraryDirectories=[/data/app/org.lds.ldssa-v8dzvQ_3IHJacrVlTX6c5A==/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libsqliteX.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
....
Here is another one for a Android 8.1.0 on device SM-J327W
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/org.lds.ldssa-1/split_config.armeabi_v7a.apk!/lib/armeabi-v7a/libsqliteX.so" segment 1: Permission denied
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
....
Let me know if you need more logs or more data....
as...@gmail.com <as...@gmail.com> #6
Samsung Galaxy S9+ (star2qltesq), Android 9
java.lang.UnsatisfiedLinkError:
at java.lang.Runtime.loadLibrary0 (Runtime.java:1012)
at java.lang.System.loadLibrary (System.java:1669)
at com.crashlytics.android.ndk.JniNativeApi.<clinit> (JniNativeApi.java:13)
at com.crashlytics.android.ndk.CrashlyticsNdk.onPreExecute (CrashlyticsNdk.java:50)
...
at io.fabric.sdk.android.Fabric.with (Fabric.java:339)
at [Application class].onCreate
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1154)
...
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1445)
LGE LG Stylo 4 (cv7a), Android 8.1
java.lang.UnsatisfiedLinkError:
at java.lang.Runtime.loadLibrary0 (Runtime.java:1016)
at java.lang.System.loadLibrary (System.java:1657)
at com.crashlytics.android.ndk.JniNativeApi.<clinit> (JniNativeApi.java:13)
at com.crashlytics.android.ndk.CrashlyticsNdk.onPreExecute (CrashlyticsNdk.java:50)
...
at io.fabric.sdk.android.Fabric.with (Fabric.java:339)
at [Application class].onCreate
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1120)
...
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:810
Since we've disabled the ability to install the app to external storage, I'm not sure if this is the same issue or if I should open a new one.
je...@gmail.com <je...@gmail.com> #7
le...@google.com <le...@google.com> #8
en...@google.com <en...@google.com> #9
[Deleted User] <[Deleted User]> #10
WARNING: The option setting 'android.bundle.enableUncompressedNativeLibs=false' is experimental and unsupported. The current default is 'true'.
Is this expected? Sounds scary.
le...@google.com <le...@google.com> #11
le...@google.com <le...@google.com> #12
ma...@gmail.com <ma...@gmail.com> #13
I can confirm that using android.bundle.enableUncompressedNativeLibs=false fixes this issue. The crash disappeared in the update that we rolled out with this setting, and we have reports from users that did have the issue on their device before, that confirm that this fixes it. Some were also able to confirm that they did have the app on external storage when it crashed.
This workaround is the safest and makes sense since it exactly reverses the behavior introduced in android gradle plugin v3.3.0, and builds I made after updating the plugin are the ones that had the issue.
I would very strongly suggest making the 'false' setting the default in subsequent android gradle plugin updates. This on-disk optimization is unusable as the combo of building app bundles, devices that have noexec external storage, users storing apps on said external storage, and ndk libs, will always result in these hard to track down, hard to reproduce for the developer but systematic crashes, unless the server-side split apk delivery blacklists these devices for delivering the optimization (there's quite a few of these devices).
jo...@google.com <jo...@google.com>
le...@google.com <le...@google.com> #14
See
This change will be effective when testing locally in Android Studio 3.6.
hi...@google.com <hi...@google.com>
im...@gmail.com <im...@gmail.com> #15
gr...@ynab.com <gr...@ynab.com> #16
It's not clear to me how this interacts with the recent changes in AGP 3.6 which cause APK sizes to double as native libs are no longer compressed.
le...@google.com <le...@google.com> #17
If you were having this issue, then yes, you should be removing 'android.bundle.enableUncompressedNativeLibs=false' from the gradle.properties.
The size of the APK being bigger because of the native libs not being compressed is (counter-intuitively) a benefit for your users: the Android platform will be able to read the native libs directly from the APK without having to uncompress them on the device first during the installation which leads to your app having a smaller footprint on the device. The APK is also compressed when it's served from the Play Store to users and the compression is usually better when the native libs are uncompressed, which leads to smaller download sizes as well. Overall, smaller download size and smaller size on device which is a win-win for end-users: the only thing that's bigger is the file you upload to the Play Console.
fb...@gmail.com <fb...@gmail.com> #18
Recently I encountered this issue after upgrading to Android Studio 3.6, without 'android.bundle.enableUncompressedNativeLibs=false' in the gradle.properties.
The call stack is as below:
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/my.test.app-2/split_config.armeabi_v7a.apk" segment 1: Permission denied
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at go.Seq.<clinit>(Seq.java:37)
at go.Seq.touch(Seq.java)
at mobile.Mobile.<clinit>(Mobile.java:12)
Should I try to add 'android.bundle.enableUncompressedNativeLibs=false' or not?
le...@google.com <le...@google.com> #19
Could you please share on what device you have seen this issue happen? (Brand, Model, Android API)
fb...@gmail.com <fb...@gmail.com> #20
One from firebase:
Brand: HUAWEI
Model: Y3III
Orientation: Portrait
RAM free: 367.13 MB
Disk free: 875.23 MB
plat_android Operating System
Version: 6.0
Orientation: Portrait
Rooted: No
bug_report Crash
Date: Mar 4, 2020, 3:02:00 AM
One from google play console:
moto e5
RAM 2048MB (TotalMem: 1837MB)
System on Chip: Qualcomm MSM8920 (Snapdragon 427)
Screen size: 720 x 1440 (normal)
CPU: 4x ARM Cortex-A53 (1400 Mhz)
Screen density (DPI): 320
ABI: armeabi-v7a , armeabi
SDK: Android 8.1 (SDK 27)
GPU: Qualcomm Adreno 308 (650 Mhz)
OpenGL ES version: 3.0
lo...@gmail.com <lo...@gmail.com> #21
LGE V30 Version: 9
Galaxy A3 (2017) Version 8.0.0
Galaxy S7 Version 8.0.0
How to fix it?
le...@google.com <le...@google.com> #22
Re
lo...@gmail.com <lo...@gmail.com> #23
Yes. It's the same error.
ava.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/.../base.apk!/lib/arm64-v8a/libc++_shared.so" segment 0: Permission denied
But I am not sure that it is connected with an external sd card. I don't have this information from users
lo...@gmail.com <lo...@gmail.com> #24
Because I see in the docs that "android.bundle.enableUncompressedNativeLibs = false" is for Bundles
le...@google.com <le...@google.com> #25
That property is for Bundles only indeed.
/mnt/asec/
suggests that this is related to ASEC external storage as well though.
Do you have the property android:extractNativeLibs=false
set in your AndroidManifest.xml? If so, removing it could possibly fix the issue (since that's effectively what the enableUncompressedNativeLibs property is enabling for Bundles).
lo...@gmail.com <lo...@gmail.com> #26
I don't have this property in current version.
le...@google.com <le...@google.com> #27
Aha, that probably explains it, yes.
iu...@google.com <iu...@google.com> #28
1. Variant for Android < 9.0 with extractNativeLibraries set to true and native libraries are compressed inside zip.
2. Variant for Android >= 9.0 with extractNativeLibraries set to false and native libraries are uncompressed inside zip.
If you still have this issue could you please provide information how do you generate APKs from Bundle, using Play Console or running Bundle Tool locally? If running locally which version do you run?
If it is possible could you also specify your app package name it would be very helpful for investigation.
sh...@gmail.com <sh...@gmail.com> #29
le...@google.com <le...@google.com> #30
What devices on Android 9 please? Do you have a list? It would help us so we can reach out to OEMs so they can fix those devices via OTA updates.
gl...@fitbit.com <gl...@fitbit.com> #31
For us, data from the past 7 days:
Android 10: <1% Android 9: 94% Android 8: 5%
LG: 91%
- G6: 21%
- V40 ThinQ: 13%
- LG G7 ThinQ: 10%
- other (15 devices): 47%
-
- LG Stylo 4
-
- LG Premier Pro
-
- LG Q7+
-
- LG G7 ThinQ
-
- LG V35 ThinQ
-
- LG G6
-
- V30
-
- LG G6
-
- LG Aristo 3+
-
- LG Stylo 4
-
- LG K8(2018)
Samsung: 3%
- Galaxy J7 Crown: 1%
- other (10 devices): 2%
-
- Galaxy J7 Aura
-
- SM-J337A
-
- Galaxy S9+
-
- Galaxy J7
-
- Galaxy J7 Star
-
- Galaxy S9
-
- Galaxy Tab S3
-
- Galaxy S7
-
- Galaxy A70
-
- Galaxy A20
Lenovo: 3%
- Lenovo Tab E7
Huawei: 1%
- HUAWEI Y6 2018
- HUAWEI Y7 2018
- P8 lite 2017
- Mate 20 lite
- HUAWEI P smart
- HUAWEI Y6 2018
95% of the time it's happening in the background. Unfortunately, I don't have the stat breakdown of which OEM devices are on Android 9.
We do not have extractNativeLibs
or enableUncompressedNativeLibs
set.
go...@umito.nl <go...@umito.nl> #32
Having issues as well on my bundled app. Several reports from Samsung devices on Android 9.0.
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/PKG/split_config.arm64_v8a.apk!/lib/arm64-v8a/libFOO.so" segment 1: Permission denied
Samsung: SM-N9500 SM-M305F
Too bad, I liked the idea to have smaller install size, but this clearly should not be recommended.
sa...@peilicke.de <sa...@peilicke.de> #33
I can confirm it for an APK (non-bundle) app not setting android:extractNativeLibs="true"
on the following devices (according to Firebase):
- LG G7 ThinQ
- LG G6
- LG G5
In our case this is exclusive to LG devices. Amongst those, 90% of crashes happen with Android 9, only device shows the issue with Android 8.0.0.
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/XXX-1/base.apk!/lib/arm64-v8a/libbarhopper_v2.so" segment 1: Permission denied
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at com.google.android.libraries.barhopper.BarhopperV2.<init>(BarhopperV2.java:5)
at com.google.firebase.ml.vision.barcode.zza.start(zza.java:14)
lo...@gmail.com <lo...@gmail.com> #34
I think your sentence needs to be corrected so we can understand:
Amongst those, 90% of crashes happen with Android 9, only device shows the issue with Android 8.0.0.
As is, it looks like you might have forgotten "one" between "only" and "device" but I can't be sure.
[Deleted User] <[Deleted User]> #36
Having issues as well on our bundled app. enableUncompressedNativeLibs
set to false.
Stack trace we are seeing in Firebase reports:
Caused by java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/com.---.---/split_config.arm64_v8a.apk!/lib/arm64-v8a/libshinobicharts-android.so" segment 0: Permission denied
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
Affected devices:
LG - 80%
Samsung - 20%.
no reports for other devices.
Affected android versions:
Android 7, 8, 9
iu...@google.com <iu...@google.com> #37
From the provided stack trace it looks like Android tries to read native library from the APK instead of file system location. Can you ensure that android:extractNativeLibs
is not set in Android manifest and gradle property android.bundle.enableUncompressedNativeLibs
is set to false
?
[Deleted User] <[Deleted User]> #38
android.bundle.enableUncompressedNativeLibs=false
- that's correct
regarding android:extractNativeLibs
: we are not setting it explicitly, but as i can see from Merged Manifest it is set to false
which is default value for gradle plugin 4.0.0 as i understood.
iu...@google.com <iu...@google.com> #39
I see, could you try to explicitly set extractNativeLibs
to true in your manifest?
[Deleted User] <[Deleted User]> #40
Yes. I'll try. That may take couple of weeks to see if it helps due to our release process. Thank you.
eg...@squareup.com <eg...@squareup.com> #41
We've started seeing a similar issue after switching to App Bundles (app's package name is com.squareup.cash
). The issue is seen on a large range of devices (76% Samsung, 9% LG, 15% other), on all 6.0+ OS versions (our minSdk is 21). As per my understanding, the current recommendation is to:
- Set
android.bundle.enableUncompressedNativeLibs=false
ingradle.properties
- Set
android:extractNativeLibs="true"
inAndroidManifest.xml
Planning to try this in the next release and report back on whether this fixes the issue for us.
[Deleted User] <[Deleted User]> #42
following configuration fixes the issue for us:
extractNativeLibs=true
in AndnroidManifest.xml
android.bundle.enableUncompressedNativeLibs=false
in gradle.properties
wa...@carta.com <wa...@carta.com> #43
sa...@gmail.com <sa...@gmail.com> #44
This issue is tightly related to
uz...@gmail.com <uz...@gmail.com> #45
But still have issue with xiaomi 5A, oppo, ...
[Deleted User] <[Deleted User]> #46
Adding extractNativeLibs=true
in AndroidManifest.xml
fixed the issue for me.
cr...@gmail.com <cr...@gmail.com> #47
I'm using with Flavor it's my initial suspicious.
Already try to set ABI filters ('armeabi-v7a', 'arm64-v8a', 'x86_64', 'x86'), ProGuard to Flutter Files, enableUncompressedNativeLibs, extractNativeLibs, project.setProperty("target-platform", "android-arm") and etc.
Always the same error
Flutter 2.5 Stable version
dr...@gmail.com <dr...@gmail.com> #48
en...@gmail.com <en...@gmail.com> #49
sz...@gmail.com <sz...@gmail.com> #50
We are facing the same issue. Changing the following properties seem to be solving the issue on some devices, but makes the app crash on Pixel 3 XL running Android 9
extractNativeLibs=true
in AndnroidManifest.xml
android.bundle.enableUncompressedNativeLibs=false
in gradle.properties
de...@gmail.com <de...@gmail.com> #51
st...@gmail.com <st...@gmail.com> #53
sh...@gmail.com <sh...@gmail.com> #54
ya...@pplingo.com <ya...@pplingo.com> #55
uz...@gmail.com <uz...@gmail.com> #56
zh...@gmail.com <zh...@gmail.com> #57
extractNativeLibs=true in AndnroidManifest.xml
android.bundle.enableUncompressedNativeLibs=false in gradle.properties
OPPO PDKM00 Android 12 Doesn't work
bo...@justin.tv <bo...@justin.tv> #59
I verified that
packagingOptions.jniLibs.useLegacyPackaging = true
compressed my native libraries by downloading an APK from the play store and looking at the library sizes with
unzip -v config.arm64_v8a.apk
On the version before I set useLegacyPackaging = true
, the Cmpr
column was 0%
for all native libs, but on the version after I set useLegacyPackaging = true
, the Cmpr
showed between 36%
and 70%
for all native libs, so I'm confident that useLegacyPackaging = true
actually compresses the libs in the APK.
bo...@justin.tv <bo...@justin.tv> #60
I added
packagingOptions.jniLibs.useLegacyPackagin = true
and I'm still seeing crashes when loading native libs, but the exception changed. Previously, it was a permission error: Welp I’m still seeing crashes, but now my exception has changed:
useLegacyPackaging=false
:
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/tv.twitch.android.app-2/split_config.armeabi_v7a.apk!/lib/armeabi-v7a/libtwitchsdk.so" segment 1: Permission denied
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at tv.twitch.Library$1.run(Library.java:65)
at tv.twitch.JniThreadValidator.callJniRunnable(JniThreadValidator.java:21)
at tv.twitch.Library.loadLibrary(Library.java:62)
at tv.twitch.android.sdk.SDKLibrary.loadLibrary(SDKLibrary.java:53)
at tv.twitch.Library.initialize(Library.java:85)
at tv.twitch.android.sdk.SDKServicesController.<init>(SDKServicesController.java:141)
at tv.twitch.android.sdk.SDKServicesController_Factory.newInstance(SDKServicesController_Factory.java:42)
at tv.twitch.android.sdk.SDKServicesController_Factory.get(SDKServicesController_Factory.java:31)
at tv.twitch.android.sdk.SDKServicesController_Factory.get(SDKServicesController_Factory.java:11)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at tv.twitch.android.app.core.ApplicationLifecycleController_Factory.get(ApplicationLifecycleController_Factory.java:185)
at tv.twitch.android.app.core.ApplicationLifecycleController_Factory.get(ApplicationLifecycleController_Factory.java:43)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.injectTwitchApplication(DaggerAppComponent.java:51752)
at tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.inject(DaggerAppComponent.java:51747)
at tv.twitch.android.app.consumer.TwitchApplication.onCreate(TwitchApplication.java:122)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1155)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6171)
at android.app.ActivityThread.access$1100(ActivityThread.java:208)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:205)
at android.app.ActivityThread.main(ActivityThread.java:6993)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:884)
But now it's a file not found error:
useLegacyPackaging=true
on a Xiaomi
:
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/tv.twitch.android.app-V8h3LJXVboHHCGZtVOXQyg==/base.apk"],nativeLibraryDirectories=[/data/app/tv.twitch.android.app-V8h3LJXVboHHCGZtVOXQyg==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libtwitchsdk.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1029)
at java.lang.System.loadLibrary(System.java:1673)
at tv.twitch.Library$1.run(Library.java:65)
at tv.twitch.JniThreadValidator.callJniRunnable(JniThreadValidator.java:21)
at tv.twitch.Library.loadLibrary(Library.java:62)
at tv.twitch.android.sdk.SDKLibrary.loadLibrary(SDKLibrary.java:53)
at tv.twitch.Library.initialize(Library.java:85)
at tv.twitch.android.sdk.SDKServicesController.<init>(SDKServicesController.java:141)
at tv.twitch.android.sdk.SDKServicesController_Factory.newInstance(SDKServicesController_Factory.java:42)
at tv.twitch.android.sdk.SDKServicesController_Factory.get(SDKServicesController_Factory.java:31)
at tv.twitch.android.sdk.SDKServicesController_Factory.get(SDKServicesController_Factory.java:11)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at tv.twitch.android.app.core.ApplicationLifecycleController_Factory.get(ApplicationLifecycleController_Factory.java:185)
at tv.twitch.android.app.core.ApplicationLifecycleController_Factory.get(ApplicationLifecycleController_Factory.java:43)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.injectTwitchApplication(DaggerAppComponent.java:51752)
at tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.inject(DaggerAppComponent.java:51747)
at tv.twitch.android.app.consumer.TwitchApplication.onCreate(TwitchApplication.java:122)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1123)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5779)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1670)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6536)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:411)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)
useLegacyPackaging=true
on a Samsung
:
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "libtwitchsdk.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
at java.lang.Runtime.loadLibrary0(Runtime.java:998)
at java.lang.System.loadLibrary(System.java:1661)
at tv.twitch.Library$1.run(Library.java:65)
at tv.twitch.JniThreadValidator.callJniRunnable(JniThreadValidator.java:21)
at tv.twitch.Library.loadLibrary(Library.java:62)
at tv.twitch.android.sdk.SDKLibrary.loadLibrary(SDKLibrary.java:53)
at tv.twitch.Library.initialize(Library.java:85)
at tv.twitch.android.sdk.SDKServicesController.<init>(SDKServicesController.java:141)
at tv.twitch.android.sdk.SDKServicesController_Factory.newInstance(SDKServicesController_Factory.java:42)
at tv.twitch.android.sdk.SDKServicesController_Factory.get(SDKServicesController_Factory.java:31)
at tv.twitch.android.sdk.SDKServicesController_Factory.get(SDKServicesController_Factory.java:11)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at tv.twitch.android.app.core.ApplicationLifecycleController_Factory.get(ApplicationLifecycleController_Factory.java:185)
at tv.twitch.android.app.core.ApplicationLifecycleController_Factory.get(ApplicationLifecycleController_Factory.java:43)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.injectTwitchApplication(DaggerAppComponent.java:51752)
at tv.twitch.android.app.consumer.dagger.DaggerAppComponent$AppComponentImpl.inject(DaggerAppComponent.java:51747)
at tv.twitch.android.app.consumer.TwitchApplication.onCreate(TwitchApplication.java:122)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7598)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
th...@gmail.com <th...@gmail.com> #61
I see enableUncompressedNativeLibs
is now removed from AGP 8.1.0. What's the workaround now?
ma...@gmail.com <ma...@gmail.com> #62
On Sat, Aug 12, 2023 at 10:46 AM <buganizer-system@google.com> wrote:
is...@google.com <is...@google.com>
cu...@gmail.com <cu...@gmail.com> #63
is there any replacement for "enableUncompressedNativeLibs=false" after AGP 8.1.0?
ma...@marcardar.com <ma...@marcardar.com> #64
#63 ChatGPT will answer that question.
android {
packaging {
jniLibs {
useLegacyPackaging = true
}
}
}
de...@gmail.com <de...@gmail.com> #65
android {
packaging {
jniLibs {
useLegacyPackaging = true
}
}
}
cu...@gmail.com <cu...@gmail.com> #66
On the one hand, below code in AGP8 will cause aab download size increase.
android {
packaging {
jniLibs {
useLegacyPackaging = true
}
}
}
before in AGP7 we use
android {
packaging {
jniLibs {
useLegacyPackaging = false
}
}
}
and enableUncompressedNativeLibs=false
But if we use "useLegacyPackaging = false for jniLibs" in AGP8 , i find when install aab ,the native lib(.so files) will not be extract to directory like "/data/app/~~zDyIMq8XI7U9xQqs3SiIAA==/com.app-nZl0Vjw0B-M0Ar5mXvqy0A==/lib/x86_64" and when load so file use such directory "getApplicationContext().getApplicationInfo().nativeLibraryDir" can not load so file, then cause crashes.
cu...@gmail.com <cu...@gmail.com> #67
After look at AGP 7 source code normally, compressNativeLibs is same value of useLegacyPackaging, but when set "enableUncompressedNativeLibs=false", the compressNativeLibs is set true finally. so when install aab file ,so files can be extracted into directory like "/data/app/~~zDyIMq8XI7U9xQqs3SiIAA==/com.app-nZl0Vjw0B-M0Ar5mXvqy0A==/lib/x86_64" but in AGP 8 ,if we want so files to be extracted into such lib directory, we need to specified "useLegacyPackaging = true" for jniLibs, but will cause adb download size increase several Mbs.
is these two properties "useLegacyPackaging = false " and "enableUncompressedNativeLibs = false " are kind of conflict?
so how to config the build properties, for we can achieve both aab download size not increasing and so files also be extracted into "/data/app/lib" directory?
PackageBundleTask.kt
task.compressNativeLibs.set(
componentProperties.packaging.jniLibs.useLegacyPackagingFromBundle
)
// TODO(b/132103049, b/174695257) Deprecate the BooleanOption with instructions to use
// the DSL instead.
if (!creationConfig.services.projectOptions[BooleanOption.ENABLE_UNCOMPRESSED_NATIVE_LIBS_IN_BUNDLE]) {
task.compressNativeLibs.set(true)
}
task.compressNativeLibs.disallowChanges()
also above logic is removed in AGP8 source code.
Description
2019-03-06 14:20:50.134 15973-15973/org.sqlite.app.customsqlite E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.sqlite.app.customsqlite, PID: 15973
java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/mnt/asec/org.sqlite.app.customsqlite-1/split_config.armeabi_v7a.apk!/lib/armeabi-v7a/libsqliteX.so" segment 1: Permission denied
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
at org.sqlite.app.customsqlite.MainActivity$runTheTests$1.invokeSuspend(MainActivity.kt:45)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
We have been trying to narrow the bug down and this is what we have found:
- This happens on a wide variety of devices (not all devices have this issue). Here is a list of some of the many devices that we have seen it on (from Crashlytics)
Galaxy Note9
Galaxy J5
Galaxy J7
Galaxy J2 Prime
Galaxy Tab3 VE 7.0
Galaxy Grand Prime Plus
Moto G (1st Gen)
Galaxy J1 Ace
A800 PRO
HTC Desire 630 dual sim
SM-G532M
Hisense U962
Y5 2017
.... and many more devices (if you need a list of more devices... I can add them)...
- This has happened on All/Any Android OS versions (4, 5, 6, 7, 8, 9)
- This ONLY happens when the user has moved the app to the SD Card, then they run the app (if the user moves the app back to Internal memory, then the app runs fine again)
- This ONLY happens with a App Bundle Deployment (if I deploy the app via APK, then there is no crash)
- The crash happens when the SQLite library is loaded: System.loadLibrary("sqliteX")
Attached is a sample project that has a copy of the "SQLite Android Bindings" library that has been updated (NOTE: The same result/error occurs if I simply use the "Precompiled Binaries for Android" aar from
To reproduce:
1. Get a device that has the issue (for us we used the Samsung J7)
2. Compile the attached project ("./gradlew bundle")
3. Deploy the built App Bundle to the device using the bundletool
4. Move the installed app to the SD Card
5. Launch the app
6. Tap on the "RUN THE TESTS" button
Result:
App will crash with a UnsatisfiedLinkError exception when calling the following code:
System.loadLibrary("sqliteX")
Workaround:
The only workaround that we could find is to either deploy APK files instead of App Bundle files... or detect for the UnsatisfiedLinkError and prompt the user to move the app back to Internal Storage