White screen, no crash, logged ClassNotFoundException OnUnhandledKeyEventListener
I am writing up this bug just in case others search for it, or if there is something that could prevent it from Nativescript side, or even recreate it. Perhaps it will not be an issue for others, or as Nativescript and the Android SDK's progress.
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 6.0.2
- Cross-platform modules:
- Android Runtime:6.0.2
- iOS Runtime (if applicable):only Android
- Plugin(s): nativescript-vue + many others
Describe the bug User's app got into a state where only a white screen was shown. Claims was using the app normally, then white screen occurred. The app did not crash, it was "running". Force close of app, even restart of phone, would not recover.
Was able to physically connect device to adb logcat and saw app begin, than this error message 3 times
09-13 10:49:56.563 29143 29143 I zygote64: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
09-13 10:49:56.563 29143 29143 I zygote64: at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
...lots more
09-13 10:49:56.563 29143 29143 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/base.apk", zip file "/data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/split_config.arm64_v8a.apk", zip file "/data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/split_config.en.apk", zip file "/data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/split_config.xxxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/lib/arm64, /data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/base.apk!/lib/arm64-v8a, /data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/com.coremanagementservices.SmartInspect1-djjWshbD40r3JN5yMjwqqw==/split_config.en.apk!/lib/arm64-v8a, /data/app/co
09-13 10:49:56.563 29143 29143 I zygote64: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:93)
...lots more
To Reproduce Unsure what causes this behavior. Simply logging this issue so it could be known - might be rare or might be closed as "not repeatable".
Expected behavior No white screen of doom. Either crash the app (to gather Crashlytics) or avoid the behavior.
Sample project None yet.
Additional context My symptoms (white screen, no crash, and logs) are like stated in this StackOverflow: https://stackoverflow.com/questions/51782548/androidxappcompat-iart-error-android-view-viewonunhandledkeyeventlistener/52954286#52954286
Which relates to this Google Issue: https://issuetracker.google.com/issues/120750246
That error seems to affect Android apps built on SDK 28 (like tns-android 6.0.2) and running on a lower SDK (like my user's Samsung Galaxy S7). Unsure what other stars align here, we cannot repeat on our Moto G7, G4 or G1, Kindle Fire or OnePlus 6 devices.
Today our app release will be built on tns-android 6.1.1 and tns 6.1.1 which uses SDK 29 by default, so maybe the error will never happen again. I will follow up with more info, and response to questions if you have any.
Could be related to https://github.com/NativeScript/nativescript-angular/issues/1967