synonymdev / bitkit

Self-custodial Bitcoin and Lightning Wallet for Android and iOS.
https://bitkit.to
MIT License
110 stars 23 forks source link

[Bug]: Crash on start when running on Android 8.1 (SDK 27) #1826

Closed catch-21 closed 2 months ago

catch-21 commented 3 months ago

Describe the bug

When Bitkit is run on Android 8.1 is crashes with Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" after onboarding when the main screen is displayed. This occurred on both a real and emulated device.

Reproduce

  1. Running an android device with version 8.1 (sdk api 27)
  2. launch Bitkit (complete onboarding)
  3. Crashes when main screen is displayed after onboarding or subsequent runs

Screenshots / Recording

sdk27_crash.webm

Operating system

Android 13 TKQ1.220829.002

Bitkit version

3aa7c7646ced4fc56f3960ffdace5b782204f9b2

Log output

05-14 14:55:50.654  1368  1674 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=to.bitkit/com.bitkit.MainActivity bnds=[439,1196][641,1474]} from uid 10013
05-14 14:55:50.672  1368  1674 I ActivityManager: Start proc 3400:to.bitkit/u0a59 for activity to.bitkit/com.bitkit.MainActivity
05-14 14:55:50.712  3400  3400 W linker  : "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a/libc++_shared.so" unused DT entry: type 0x70000001 arg 0x0
05-14 14:55:50.712  3400  3400 I chatty  : uid=10059(to.bitkit) identical 3 lines
05-14 14:55:50.712  3400  3400 W linker  : "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a/libc++_shared.so" unused DT entry: type 0x70000001 arg 0x0
05-14 14:55:50.714  3400  3400 W linker  : "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a/libruntimeexecutor.so" unused DT entry: type 0x70000001 arg 0x0
05-14 14:55:50.714  3400  3400 I chatty  : uid=10059(to.bitkit) identical 1 line
05-14 14:55:50.714  3400  3400 W linker  : "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a/libruntimeexecutor.so" unused DT entry: type 0x70000001 arg 0x0
05-14 14:55:50.765  1113  1113 D SurfaceFlinger: duplicate layer name: changing to.bitkit/com.bitkit.MainActivity to to.bitkit/com.bitkit.MainActivity#1
05-14 14:55:50.799  1368  1394 I ActivityManager: Displayed to.bitkit/com.bitkit.MainActivity: +136ms
05-14 14:55:52.213  3400  3423 I MMKV    : Installing MMKV JSI Bindings for MMKV root directory: /data/user/0/to.bitkit/files/mmkv
05-14 14:55:52.919  3400  3400 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk"],nativeLibraryDirectories=[/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/lib/arm64, /data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
05-14 14:55:52.919  3400  3400 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk"],nativeLibraryDirectories=[/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/lib/arm64, /data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
05-14 14:55:52.919  3400  3400 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk"],nativeLibraryDirectories=[/data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/lib/arm64, /data/app/to.bitkit-smGWPrV0KQ3XYDw9RrEx1A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
05-14 14:55:53.849  3400  3424 E AndroidRuntime: Process: to.bitkit, PID: 3400
05-14 14:55:53.850  1368  1674 W ActivityManager:   Force finishing activity to.bitkit/com.bitkit.MainActivity
05-14 14:55:53.852  1368  1388 I ActivityManager: Showing crash dialog for package to.bitkit u0
ovitrif commented 2 months ago

Cause of the issue:

StackOverflow Q&A

Arc 2024-06-04 002451

TL;DR; If intended to patch/hack-fix this, one has to do dependencies dance that is recommended against by Google. The proper fix would be to just remove support for obsolete devices.

Those devices are too slow anyways for Lightning on-device, I think @Jasonvdb would agree.

So, all in all, best fix in our case is in the PR proposed as fix: lock support to devices that can run at least Android 9.