bug: Crashlytics + Android Runtime 5.0 incompatible
See original GitHub issueI’m still narrowing this one down, but since the RC and even up to the full release of {N} 5.0, I have been unable to get the app to run consistently with the 5.0 Android Runtime enbaled.
Essentially when live-syncing with Crashlytics enabled on the app (even with 0 actual calls to any of its methods) and when using the Android Runtime 5.0, the app will launch and then will just sit on the launch screen, with the emulator or device still expending significant processing (and getting warm).
The {N} CLI will never actually attach, and will then timeout.
If you then open adb shell
then logcat
you will see this loop (not sure where it “starts” but you can see where it will repeat; p.client.mobil
is the app package name, that gets truncated for some reason):
11-07 11:06:53.387 13593 13593 D TNS.Native: JNI_ONLoad
11-07 11:06:53.387 13593 13593 D TNS.Native: JNI_ONLoad END
11-07 11:06:53.425 13593 13604 I p.client.mobil: Background concurrent copying GC freed 10376(1100KB) AllocSpace objects, 6(120KB) LOS objects, 50% free, 1877KB/3MB, paused 2.030ms total 104.818ms
11-07 11:06:53.485 13593 13593 W p.client.mobil: Accessing hidden field Ljava/lang/Boolean;->value:Z (light greylist, JNI)
11-07 11:06:53.516 13593 13593 D TNS.Native: V8 version 6.9.427.23
11-07 11:06:52.023 13509 13509 F libc : /usr/local/google/buildbot/src/android/ndk-release-r17/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type tns::NativeScriptException" failed
11-07 11:06:53.521 13593 13593 F libc : /usr/local/google/buildbot/src/android/ndk-release-r17/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type tns::NativeScriptException" failed
11-07 11:06:53.581 1869 1869 I Zygote : Process 13593 exited due to signal (6)
11-07 11:06:53.583 1916 10389 I ActivityManager: Process com.ugroupmedia.pnp.client.mobile (pid 13593) has died: fore TOP
11-07 11:06:53.587 1916 1933 W libprocessgroup: kill(-13593, 9) failed: No such process
11-07 11:06:53.587 1916 1933 I libprocessgroup: Successfully killed process cgroup uid 10102 pid 13593 in 0ms
11-07 11:06:53.602 1916 7007 I ActivityManager: Killing 13620:com.google.android.gms/u0a8 (adj 900): empty #1
11-07 11:06:53.603 1916 1933 W libprocessgroup: kill(-13620, 9) failed: No such process
11-07 11:06:53.614 13677 13677 I p.client.mobil: Not late-enabling -Xcheck:jni (already on)
11-07 11:06:53.616 1916 1932 I ActivityManager: Start proc 13677:com.ugroupmedia.pnp.client.mobile/u0a102 for activity com.ugroupmedia.pnp.client.mobile/com.tns.NativeScriptActivity
11-07 11:06:53.633 13677 13677 W p.client.mobil: Unexpected CPU variant for X86 using defaults: x86_64
11-07 11:06:53.649 1916 1933 W libprocessgroup: kill(-13620, 9) failed: No such process
11-07 11:06:53.649 1916 10389 D WificondControl: Scan result ready event
11-07 11:06:53.650 1868 1868 I Zygote : Process 13620 exited due to signal (9)
11-07 11:06:53.693 1916 1933 W libprocessgroup: kill(-13620, 9) failed: No such process
11-07 11:06:53.693 1916 1933 I libprocessgroup: Successfully killed process cgroup uid 10008 pid 13620 in 90ms
11-07 11:06:54.407 13677 13677 I CrashlyticsCore: Initializing Crashlytics 2.6.3.25
11-07 11:06:54.492 13704 13704 W gle.android.gm: Unexpected CPU variant for X86 using defaults: x86_64
11-07 11:06:54.494 1916 1932 I ActivityManager: Start proc 13704:com.google.android.gms/u0a8 for service com.google.android.gms/.ads.identifier.service.AdvertisingIdService
11-07 11:06:54.497 13704 13704 E gle.android.gm: Not starting debugger since process cannot load the jdwp agent.
11-07 11:06:54.505 1868 13708 I zygote64: Background concurrent copying GC freed 6565(2MB) AllocSpace objects, 0(0B) LOS objects, 75% free, 959KB/3MB, paused 5.526ms total 16.421ms
11-07 11:06:54.577 13677 13677 I CrashlyticsInitProvider: CrashlyticsInitProvider initialization successful
11-07 11:06:54.578 13704 13704 I gle.android.gm: The ClassLoaderContext is a special shared library.
11-07 11:06:54.580 13704 13704 I chatty : uid=10008(com.google.android.gms) identical 1 line
11-07 11:06:54.581 13704 13704 I gle.android.gm: The ClassLoaderContext is a special shared library.
11-07 11:06:54.604 13704 13704 W GmsApplication: Failed to invoke the SupplierSetterRegistry.
11-07 11:06:54.660 13677 13716 I FA : App measurement is starting up, version: 14700
11-07 11:06:54.661 13677 13716 I FA : To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
11-07 11:06:54.661 13677 13716 I FA : To enable faster debug mode event logging run:
11-07 11:06:54.661 13677 13716 I FA : adb shell setprop debug.firebase.analytics.app com.ugroupmedia.pnp.client.mobile
11-07 11:06:54.722 13677 13730 W DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
11-07 11:06:54.732 13704 13704 V NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 287 native methods...
11-07 11:06:54.739 13677 13677 D FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
11-07 11:06:54.739 13677 13677 I FirebaseInitProvider: FirebaseApp initialization successful
11-07 11:06:54.754 13704 13704 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
11-07 11:06:54.756 13704 13704 I ProviderInstaller: Installed default security provider GmsCore_OpenSSL
11-07 11:06:54.794 13677 13736 W DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
11-07 11:06:54.804 13677 13736 I FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
11-07 11:06:54.804 13677 13736 I FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
11-07 11:06:54.854 13677 13738 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
11-07 11:06:54.887 13704 13704 W Primes : Primes not initialized, returning default (no-op) Primes instance which will ignore all calls. Please call Primes.initialize(...) before using any Primes API.
11-07 11:06:54.902 13704 13712 W System : A resource failed to call close.
11-07 11:06:55.026 13677 13677 I TNS.Native: NativeScript Runtime Version 5.0.0, commit 45775988ddd18a9842ade012b2323ea47cc72740
11-07 11:06:55.026 13677 13677 D TNS.Native: JNI_ONLoad
11-07 11:06:55.026 13677 13677 D TNS.Native: JNI_ONLoad END
Considering how vague that all is, it took me a while to narrow down the exact cause, and I hadn’t suspected the Firebase plugin, and even when I did, I didn’t suspect the Crashlytics (which in its basic usage is just some Gradle plugins).
This can be repro reduced by creating an new {N} project (I’m using {N}+Angular, but I suspect the same would happen with the other flavours: JS/TS/Vue).
CLI also has no difference (4.2 or 5.0 have same result), nor does tns-core-modules or its widgets (either 4.2 or 5.0).
Repro:
tns create xxx --ng
(as mentioned previously, I doubt the NG has any impact here, but I haven’t tested otherwise.cd xxx && npm i nativescript-plugin-firebase
- Fill out the firebase configuration questions answering
y
for onlyusing_android
andcrashlytics
- Add a valid google-service.json (likely need to change the
package.json
nativescript.id
to match that too. tns run android
Result: App will launch and get stuck in a boot/crash loop and your PC/Device will get very warm.
Since there was no complaint in that crash loop about Crashlytics (if anything it says several things about its success), I had even tried before narrowing it down to the plugin to build a custom runtime between 4.2 and 5.0 changes, leaving a number of things but reverting other. However, I hadn’t tried reverting to many changes to the gradle stuff, other than the order that App/Plugin gradles are applied now, and still no result.
Now that I know its crashlytics build process that is to blame, I suspect it has something to do with the slight bumps of 'com.android.tools.build:gradle'
in some of the portions, but not to the same and not fully.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (4 by maintainers)
Top GitHub Comments
Thanks a million, @NickIliev! It’s indeed the exact same problem I tackled before in #549 (but totally forgot about it). That
assets
folder changed tomerge[Debug]Assets
and the script needs to adjusted accordingly. I should be able to make this compatible with any {N} version. Gonna fly SOF ✈️AMS now, but will take care of it when I’m home.@EddyVerbruggen Just tried the build and can confirm. 😁