NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

Linking errors in NDK builds #1135

Open saschaarthur opened 4 years ago

saschaarthur commented 4 years ago

Firebase reports us linking errors:

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

we are building our aabs with:

tns build android --release --key-store-path android.keystore --key-store-password ${KEYSTORE_PASSWORD} --key-store-alias keepa --key-store-alias-password ${KEYSTORE_PASSWORD} --env.aot --env.snapshot --env.compileSnapshot --env.uglify --env.report --env.hiddenSourceMap --aab

Our output looks fine: output.log

Running on nativescript 6.4.1 (more infos about the env you see in the docker tag)

Builds are executed with our docker container (tag: 18.04-10.x-6.4.1-28.0.3-1.20.1-21.0.6113669): https://hub.docker.com/r/scratchy/nativescript-cli

Please advice, we have a lot of issues with the build process and just released our first app with nativescript and have about 10% crashing devices - even if we dont see any critical output in any of the logs. We disabled now aab builds because it seems the build process is not clean, hows this going we gonna see after a couple of days...

Related to https://github.com/NativeScript/nativescript-cli/issues/5298 https://github.com/NativeScript/nativescript-dev-webpack/issues/1134

NathanaelA commented 4 years ago

One thing that stood out in your output was:

The provided Android NDK version is different than the required one - v21.0.6113669

You might double check which version of the NDK you are using.


However as to your error at the top;

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

Sounds like one of the .AAB's was possibly generated wrong; probably the x86 one based on the error -- which would only be a few devices using it as their are very few x86 android devices. You can try installing the x86 aab on a emulator and see what happens... Or you can open up the .aab file and verify it does have a libNativeScript.so in it.

saschaarthur commented 4 years ago

We using exactly this version of the NDK which its complaining about what we should use. Thanks will try your idears soon with opening the aab and check the x84 version