Hi
I'm having troubles with my Xamarin.Forms android app.
Generally speaking, the app works fine. However, there's a special case when it doesn't, which then breaks the app completely. When I put the app in the background, and leave it there for long enough, when resumed the UI is not getting "loaded" - the app gets stuck on an 'init' screen (not even a splash screen) with just colored background showing. Unfortunately I can't replicate this situation when debugging, so I'm reaching out to the community for an advice.
Details:
After getting the app into this state, when loading the app from the background after a long time, the app behaves as explained above. Afterwards, any fresh launch of the app ends with the same result. When I connect with adb logcat to my device, it seems that the app got itself into some sort of infinte loop of trying to load this library libmonosgen-2.0
. Because it cannot find it, it kills the app process and retries...
Here is the output from logcat:
3593 I ActivityManager: Start proc 8127:com.<app_name>/u0a608 for activity com.<app_name>/md584b42f4d6694c2e36108d8eacdde5765.SplashScreen 03-15 20:24:35.387 8127 8127 I zygote64: Late-enabling -Xcheck:jni 03-15 20:24:35.530 8127 8127 I MultiDex: VM with version 2.1.0 has multidex support 03-15 20:24:35.530 8127 8127 I MultiDex: install 03-15 20:24:35.530 8127 8127 I MultiDex: VM has multidex support, MultiDex support library is disabled. 03-15 20:24:35.565 8127 8127 W monodroid: Creating public update directory:
/data/user/0/com./files/.__override__ 03-15 20:24:35.565 8127 8127 W monodroid: Using override path: /data/user/0/com.<app_name>/files/.__override__ 03-15 20:24:35.565 8127 8127 W monodroid: Using override path: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__ 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/links/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 W monodroid: Trying to load sgen from: /system/lib/libmonosgen-2.0.so 03-15 20:24:35.566 8127 8127 F monodroid: cannot find libmonosgen-2.0.so in override_dir: /data/user/0/com.<app_name>/files/.__override__, app_libdir: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64 nor in previously printed locations. 03-15 20:24:35.566 8127 8127 F monodroid: Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported. 03-15 20:24:35.566 8127 8127 F monodroid: Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration). 03-15 20:24:35.596 3583 6571 I ActivityManager: Process com.<app_name> (pid 8127) has died: fore TOP 03-15 20:24:35.597 3583 3601 W zygote64: kill(-8127, 9) failed: No such process 03-15 20:24:35.597 3132 3132 I Zygote : Process 8127 exited cleanly (15) 03-15 20:24:35.611 3583 6571 I ActivityManager: Start proc 8142:com.<app_name>/u0a608 for activity com.<app_name>/md584b42f4d6694c2e36108d8eacdde5765.SplashScreen 03-15 20:24:35.612 8142 8142 I zygote64: Late-enabling -Xcheck:jni 03-15 20:24:35.633 3583 3601 W zygote64: kill(-8127, 9) failed: No such process 03-15 20:24:35.633 3583 3601 I zygote64: Successfully killed process cgroup uid 10608 pid 8127 in 36ms 03-15 20:24:35.742 8142 8142 I MultiDex: VM with version 2.1.0 has multidex support 03-15 20:24:35.742 8142 8142 I MultiDex: install 03-15 20:24:35.742 8142 8142 I MultiDex: VM has multidex support, MultiDex support library is disabled. 03-15 20:24:35.786 8142 8142 W monodroid: Creating public update directory:
/data/user/0/com./files/.__override__ 03-15 20:24:35.786 8142 8142 W monodroid: Using override path: /data/user/0/com.<app_name>/files/.__override__ 03-15 20:24:35.786 8142 8142 W monodroid: Using override path: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__ 03-15 20:24:35.786 8142 8142 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/links/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 W monodroid: Trying to load sgen from: /system/lib/libmonosgen-2.0.so 03-15 20:24:35.787 8142 8142 F monodroid: cannot find libmonosgen-2.0.so in override_dir: /data/user/0/com.<app_name>/files/.__override__, app_libdir: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64 nor in previously printed locations. 03-15 20:24:35.787 8142 8142 F monodroid: Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported. 03-15 20:24:35.787 8142 8142 F monodroid: Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration). 03-15 20:24:35.817 3583 21143 I ActivityManager: Process com.<app_name> (pid 8142) has died: fore TOP 03-15 20:24:35.817 3583 3601 W zygote64: kill(-8142, 9) failed: No such process 03-15 20:24:35.818 3132 3132 I Zygote : Process 8142 exited cleanly (15) 03-15 20:24:35.833 3583 21143 I ActivityManager: Start proc 8157:com.<app_name>/u0a608 for activity com.<app_name>/md584b42f4d6694c2e36108d8eacdde5765.SplashScreen 03-15 20:24:35.837 8157 8157 I zygote64: Late-enabling -Xcheck:jni 03-15 20:24:35.862 3583 3601 W zygote64: kill(-8142, 9) failed: No such process 03-15 20:24:35.862 3583 3601 I zygote64: Successfully killed process cgroup uid 10608 pid 8142 in 44ms 03-15 20:24:35.956 8157 8157 I MultiDex: VM with version 2.1.0 has multidex support 03-15 20:24:35.956 8157 8157 I MultiDex: install 03-15 20:24:35.956 8157 8157 I MultiDex: VM has multidex support, MultiDex support library is disabled. 03-15 20:24:35.993 8157 8157 W monodroid: Creating public update directory:
/data/user/0/com./files/.__override__ 03-15 20:24:35.993 8157 8157 W monodroid: Using override path: /data/user/0/com.<app_name>/files/.__override__ 03-15 20:24:35.993 8157 8157 W monodroid: Using override path: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__ 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /storage/emulated/0/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/com.<app_name>/files/.__override__/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /data/user/0/com.<app_name>/files/.__override__/links/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 W monodroid: Trying to load sgen from: /system/lib/libmonosgen-2.0.so 03-15 20:24:35.994 8157 8157 F monodroid: cannot find libmonosgen-2.0.so in override_dir: /data/user/0/com.<app_name>/files/.__override__, app_libdir: /data/app/com.<app_name>-FxDDioqwXRGIUHcRRW4_0w==/lib/arm64 nor in previously printed locations. 03-15 20:24:35.994 8157 8157 F monodroid: Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported. 03-15 20:24:35.994 8157 8157 F monodroid: Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration). 03-15 20:24:36.033 3583 6573 I ActivityManager: Process com.<app_name> (pid 8157) has died: fore TOP 03-15 20:24:36.033 3583 3601 W zygote64: kill(-8157, 9) failed: No such process 03-15 20:24:36.035 3132 3132 I Zygote : Process 8157 exited cleanly (15)
Info about the app:
Xamarin.Forms v2.5.0.280555
Xamarin.Maps v2.5.0.280555
Min Android v19 - KitKat
Target Android v26 - Oreo
The app is being tested on Nexus 5X with Android v8.1.0
I should also mention that I use MvvmCross 5.6.3 and the first page is a Master Details with the map showing by default in the Details.
Is this a Xamarin.Forms bug? Should I report this? Maybe I'm not doing something I should be? Specifically in OnResume method?
Any advice will be much appreciated
Cheers