AndroidX
AndroidX copied to clipboard
Crash at MonodroidRuntime::Java_mono_android_Runtime_register
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
.NET 6.0.400
Description
The app crashes when handling a notification using AndroidX.Work.Worker in background.
Steps to Reproduce
- Checkout the sample repo
- Build and launch the app
- Once you see the toast "Scheduled notification", kill the app removing it from Recents
- Wait 5 seconds, then launch the app
- Crash
Did you find any workaround?
No.
Relevant log output
Cause: null pointer dereference
x0 0000007b0eb306a8 x1 0000007b0eb307c0 x2 0000007b0eb30860 x3 0000000000000000
x4 0000007b0eb30750 x5 0000007b0eb30528 x6 0000000000000000 x7 0000000000000000
x8 0000007b0eb307c0 x9 00000000000001f5 x10 0000000000000001 x11 0000000000000000
x12 0000000000000000 x13 00000000b5be16e3 x14 0000000000000006 x15 ffffffffffffffff
x16 0000007b18fe07a8 x17 0000007ea7c0fadc x18 0000007b0dd2c000 x19 0000007b0eb306a8
x20 0000007b0eb307c0 x21 0000000000000000 x22 0000000000000118 x23 b400007ce36942d0
x24 0000007b9fc00880 x25 0000007b0eb32000 x26 0000007b7f1e9e80 x27 0000007ba0415000
x28 0000007b0eb309a0 x29 0000007b0eb30740
lr 0000007b18de492c sp 0000007b0eb306a0 pc 0000007b18de4998 pst 0000000020001000
backtrace:
#00 pc 000000000010a998 /data/app/~~NlbrfHs5ba3V6liwEbCluA==/com.companyname.net6notifications-oabfrmJ4bWOpNGyqujVDwQ==/lib/arm64/libmonosgen-2.0.so (BuildId: 4a5dd4396e8816b7f69881838bd549285213d53b)
#01 pc 000000000010a7e0 /data/app/~~NlbrfHs5ba3V6liwEbCluA==/com.companyname.net6notifications-oabfrmJ4bWOpNGyqujVDwQ==/lib/arm64/libmonosgen-2.0.so (BuildId: 4a5dd4396e8816b7f69881838bd549285213d53b)
#02 pc 000000000009abe4 /data/app/~~NlbrfHs5ba3V6liwEbCluA==/com.companyname.net6notifications-oabfrmJ4bWOpNGyqujVDwQ==/lib/arm64/libmonosgen-2.0.so (mono_runtime_invoke+52) (BuildId: 4a5dd4396e8816b7f69881838bd549285213d53b)
#03 pc 000000000002af5c /data/app/~~NlbrfHs5ba3V6liwEbCluA==/com.companyname.net6notifications-oabfrmJ4bWOpNGyqujVDwQ==/lib/arm64/libmonodroid.so (xamarin::android::internal::MonodroidRuntime::Java_mono_android_Runtime_register(_JNIEnv*, _jstring*, _jclass*, _jstring*)+276) (BuildId: 0615bbc115b094c7682d18118b1ea0c19b27ba97)
#04 pc 0000000000440554 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 56e704c544e6c624201be2ab4933e853)
#05 pc 0000000000209398 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 56e704c544e6c624201be2ab4933e853)
#06 pc 00000000000deea8 [anon:dalvik-classes.dex extracted in memory from /data/app/~~NlbrfHs5ba3V6liwEbCluA==/com.companyname.net6notifications-oabfrmJ4bWOpNGyqujVDwQ==/base.apk] (crc643c9c45dbcdb37b8d.ReminderWorker.<clinit>+16)
#07 pc 0000000000436e00 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+576) (BuildId: 56e704c544e6c624201be2ab4933e853)
#08 pc 0000000000419360 /apex/com.android.art/lib64/libart.so (art::ClassLinker::InitializeClass(art::Thread*, art::Handle<art::mirror::Class>, bool, bool)+5532) (BuildId: 56e704c544e6c624201be2ab4933e853)
#09 pc 0000000000603798 /apex/com.android.art/lib64/libart.so (art::Class_classForName(_JNIEnv*, _jclass*, _jstring*, unsigned char, _jobject*) (.__uniq.181829539739573773940154555818377431209)+1120) (BuildId: 56e704c544e6c624201be2ab4933e853)
#10 pc 00000000004038ec /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+124)
Any news on this issue? It's gonna affect every app using local notifications, which looks pretty important to me.
This appears to have been fixed in .NET 7+ per https://github.com/xamarin/xamarin-android/issues/8120.