NativeScript / android

Android runtime for NativeScript (based on V8)
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
517 stars 136 forks source link

java.lang.UnsatisfiedLinkError aab build broken #1632

Open saschaarthur opened 3 years ago

saschaarthur commented 3 years ago

Environment

mutliple versions seems to be affected at least up to

Installed Android SDK : 29 Android SDK Build-Tools: 29.0.3 node.js : 10.21.0 nativescript : 6.7.8

Error Over the time we disabled all "optimize" features because all those seems to be bugged.. Since our version 0.3.2 we went forward and enabled .aab builds.

Now we get following error reports.

Fatal Exception: java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.mobile-tFMIkE3egIQbK2hZc5zevg==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.mobile-tFMIkE3egIQbK2hZc5zevg==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libNativeScript.so"

Fatal Exception: java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.mobile-QNIyApCG7KlgDAGIJkBlmA==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.mobile-QNIyApCG7KlgDAGIJkBlmA==/lib/arm64, /system/lib64, /vendor/lib64, /system/product/lib64]]] couldn't find "libNativeScript.so"

Theres not a single error in our build pipelines, but still the build process seems not to link the needed library correctly.. If the error rate increases further we also need to disable this again, truely disappointing.

To Reproduce active aab build, deliver to customers

Expected behavior not crashing

grafik

saschaarthur commented 3 years ago

We tried to install one apk out of the aab from the playstore, on an affected device

Name: Pixel_XL_API_29_x86_
CPU/ABI: Google APIs Intel Atom (x86)
Path: /Users/xxx/.android/avd/Pixel_XL_API_29_x86_.avd
Target: google_apis [Google APIs] (API level 29)
Skin: pixel_xl_silver
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_xl
hw.lcd.width: 1440
hw.initialOrientation: Portrait
image.androidVersion.api: 29
tag.id: google_apis
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel XL API 29 (x86)
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: false
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2560
vm.heapSize: 384
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-29/google_apis/x86/
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_XL_API_29_x86_
hw.lcd.density: 560
hw.arc: false
hw.device.hash2: MD5:f78477654d5471c3d7f705251d14e72f
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google APIs
runtime.network.latency: none
disk.dataPartition.size: 2G
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

Result:


08-19 12:02:33.654 6703 6703 E AndroidRuntime: FATAL EXCEPTION: main
08-19 12:02:33.654 6703 6703 E AndroidRuntime: Process: com.xxx.mobile, PID: 6703
08-19 12:02:33.654 6703 6703 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.mobile-BzKgnw_YbBi-AXadEUzHYQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.mobile-BzKgnw_YbBi-AXadEUzHYQ==/lib/x86, /system/lib, /system/product/lib]]] couldn't find "libNativeScript.so"
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at java.lang.System.loadLibrary(System.java:1667)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:70)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.app.ActivityThread.access$1300(ActivityThread.java:219)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:107)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:214)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:7356)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
08-19 12:02:33.654 6703 6703 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

We mark the aab builds as not usable for us as well..

NathanaelA commented 3 years ago

I'll run some tests to see if something broke in a later version.

Any chance you can try the CLI NS 6.5.0 (specifically 6.5.0 and if you have time 6.4.x) and see if it works for you to build aab files, I'm in the middle of tracing another crashing issue down so not sure when I'll have a free moment to dive into this one...

saschaarthur commented 3 years ago

We did a test with nativescript-cli v6.4.1, sadly with the same results:

nativescript-cli: 6.4.1 / Android SDK: 28 / Android SDK Build-Tools: 28.0.3

08-20 08:47:39.417 5372 5372 E AndroidRuntime: FATAL EXCEPTION: main
08-20 08:47:39.417 5372 5372 E AndroidRuntime: Process: com.xxx.mobile, PID: 5372
08-20 08:47:39.417 5372 5372 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.mobile-uXvGHJBF430p3AxuecCaYA==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.mobile-uXvGHJBF430p3AxuecCaYA==/lib/x86, /system/lib, /system/product/lib]]] couldn't find "libNativeScript.so"
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at java.lang.System.loadLibrary(System.java:1667)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at com.tns.RuntimeHelper.initRuntime(RuntimeHelper.java:70)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.app.ActivityThread.access$1300(ActivityThread.java:219)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:107)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:214)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:7356)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
08-20 08:47:39.417 5372 5372 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

I think this makes a test with CLI version 6.5.0 obsolete.

7ammer commented 3 years ago

Hello @saschaarthur , Are you still getting this error? I believe our app has the same issue. tns-android: 6.5.3

saschaarthur commented 3 years ago

Hello

We disabled our aab builds completely and wont risk it until someone states that there was fixes happening to this. I didnt heared anything about, so i guess its still problematic, but i didnt verified it..

But i see theres a milestone for 7.1 attached.. so maybe then its going to be fixed..

abhayastudios commented 3 years ago

Following... also seeing the issue above for some users in Crashlytics on NS 6.5

saschaarthur commented 3 years ago

Priority on this should be increased: https://android-developers.googleblog.com/2020/11/new-android-app-bundle-and-target-api.html

saschaarthur commented 2 years ago

@NathanaelA you removed your assignment.. is there any update? Its prob. soon forced by google as linked above..

jessorlisa commented 2 years ago

@rigor789 As you added the severity: high label - do you know if this has been addressed? As Android App Bundle Builds are mandatory since August 2021 for new apps I assume so?

I am afraid of enabling AAB for our existing app, risking crashes and eventually not being able to disable them again (requirements are not precise regarding that matter).

saschaarthur commented 2 years ago

highly interested here as well..

triniwiz commented 2 years ago

Can you try using the @next version of the cli it contains a newer version of the tool used for this

jessorlisa commented 2 years ago

@triniwiz Thanks for coming back to us on this. If I interpret your comment correctly this issue has not been addressed in any versions prior to @next? To be honest I am not feeling comfortable doing some t&e with our live app (>350k active users) without any positive experience reports. I hope this is understandable... 😊