Xamarin Android:应用程序崩溃(缺少libmonosgen-2.0.so)

时间:2016-03-28 12:49:01

标签: android xamarin crash

Xamarin Studio 5.10.3(build 27)

设备:小米Mi4c(Android 5.1)

我有一个Android应用程序的基本模板,我正在尝试调试应用程序。它崩溃了......

已安装的软件包:

Mono.Android.DebugRuntime
Mono.Android.Platform.ApiLevel_19

我试过了:

adb uninstall Mono.Android.DebugRuntime

然后使用IDE或

安装应用程序
MSBuild /t:Install YourProject.csproj

但没有成功。

有一个logcat:

I/ActivityManager( 1086): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity bnds=[571,978][763,1170]} from uid 10020 on display 0
V/WindowManager( 1086): addAppToken: AppWindowToken{2f39fa16 token=Token{4cf8331 ActivityRecord{3c2d63d8 u0 com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity t4972}}} to stack=1 task=4972 at 0
V/WindowManager( 1086): Adding window Window{3b68216d u0 Starting com.rinart73.niceapp} at 10 of 19 (after Window{391a3ce7 u0 org.coolreader/org.coolreader.CoolReader})
I/ActivityManager( 1086): Start proc 18762:com.rinart73.niceapp/u0a250 for activity com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity
D/WhetstoneService( 5319): set foreground process size 1  pid:18762pacakgeName:com.rinart73.niceapp
W/WhetstoneService( 5319): {WhetstonePackageInfo#PacakgeName:com.rinart73.niceappFlag:1073742848 [,SOFT_RESET] Type:0[] }not support ZRAM
D/PowerKeeperEventLogManager( 5625): notifyForegroundCompomentChanged ComponentInfo{com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity}
W/monodroid(18762): Using override path: /data/data/com.rinart73.niceapp/files/.override
W/monodroid(18762): Using override path: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.override
W/monodroid(18762): Trying to load sgen from: /data/data/com.rinart73.niceapp/files/.override/libmonosgen-2.0.so
W/monodroid(18762): Trying to load sgen from: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.override/libmonosgen-2.0.so
W/monodroid(18762): Trying to load sgen from: /data/data/com.rinart73.niceapp/lib/libmonosgen-2.0.so
F/monodroid(18762): cannot find libmonosgen-2.0.so in override_dir: /data/data/com.rinart73.niceapp/files/.override, app_libdir: /data/data/com.rinart73.niceapp/lib nor in previously printed locations.
I/ActivityManager( 1086): Process com.rinart73.niceapp (pid 18762) has died
W/WhetstoneService( 5319): {WhetstonePackageInfo#PacakgeName:com.rinart73.niceappFlag:1073742848 [,SOFT_RESET] Type:0[] }not support ZRAM
I/ActivityManager( 1086): Start proc 18797:com.rinart73.niceapp/u0a250 for activity com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity
D/PowerKeeperEventLogManager( 5625): notifyForegroundCompomentChanged ComponentInfo{com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity}
W/monodroid(18797): Using override path: /data/data/com.rinart73.niceapp/files/.override
W/monodroid(18797): Using override path: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.override
W/monodroid(18797): Trying to load sgen from: /data/data/com.rinart73.niceapp/files/.override/libmonosgen-2.0.so
W/monodroid(18797): Trying to load sgen from: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.override/libmonosgen-2.0.so
W/monodroid(18797): Trying to load sgen from: /data/data/com.rinart73.niceapp/lib/libmonosgen-2.0.so
F/monodroid(18797): cannot find libmonosgen-2.0.so in override_dir: /data/data/com.rinart73.niceapp/files/.override, app_libdir: /data/data/com.rinart73.niceapp/lib nor in previously printed locations.
I/ActivityManager( 1086): Process com.rinart73.niceapp (pid 18797) has died
W/WhetstoneService( 5319): {WhetstonePackageInfo#PacakgeName:com.rinart73.niceappFlag:1073742848 [,SOFT_RESET] Type:0[] }not support ZRAM
I/ActivityManager( 1086): Start proc 18833:com.rinart73.niceapp/u0a250 for activity com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity
D/PowerKeeperEventLogManager( 5625): notifyForegroundCompomentChanged ComponentInfo{com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity}
W/monodroid(18833): Using override path: /data/data/com.rinart73.niceapp/files/.override
W/monodroid(18833): Using override path: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.override
W/monodroid(18833): Trying to load sgen from: /data/data/com.rinart73.niceapp/files/.override/libmonosgen-2.0.so
W/monodroid(18833): Trying to load sgen from: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.override/libmonosgen-2.0.so
W/monodroid(18833): Trying to load sgen from: /data/data/com.rinart73.niceapp/lib/libmonosgen-2.0.so
F/monodroid(18833): cannot find libmonosgen-2.0.so in override_dir: /data/data/com.rinart73.niceapp/files/.override, app_libdir: /data/data/com.rinart73.niceapp/lib nor in previously printed locations.
I/ActivityManager( 1086): Process com.rinart73.niceapp (pid 18833) has died
W/ActivityManager( 1086): Force removing ActivityRecord{3c2d63d8 u0 com.rinart73.niceapp/md579058f2ed4a300dd704bd6ac0c3e80e0.MainActivity t4972}: app died, no saved state

Jon Douglas建议之后的Logcat:

W/monodroid(13078): Trying to load sgen from: /data/data/com.rinart73.niceapp/files/.__override__/libmonosgen-2.0.so
W/monodroid(13078): Trying to load sgen from: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.__override__/libmonosgen-2.0.so
W/monodroid(13078): Trying to load sgen from: /data/data/com.rinart73.niceapp/lib/libmonosgen-2.0.so
W/monodroid(13078): Trying to load sgen from: /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-64bit-2.0.so
W/monodroid(13078): Trying to load sgen from: /system/lib64/libmonosgen-2.0.so
F/monodroid(13078): cannot find libmonosgen-2.0.so in override_dir: /data/data/com.rinart73.niceapp/files/.__override__, app_libdir: /data/data/com.rinart73.niceapp/lib nor in previously printed locations.
W/monodroid(13112): Trying to load sgen from: /data/data/com.rinart73.niceapp/files/.__override__/libmonosgen-2.0.so
W/monodroid(13112): Trying to load sgen from: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.__override__/libmonosgen-2.0.so
W/monodroid(13112): Trying to load sgen from: /data/data/com.rinart73.niceapp/lib/libmonosgen-2.0.so
W/monodroid(13112): Trying to load sgen from: /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-64bit-2.0.so
W/monodroid(13112): Trying to load sgen from: /system/lib64/libmonosgen-2.0.so
F/monodroid(13112): cannot find libmonosgen-2.0.so in override_dir: /data/data/com.rinart73.niceapp/files/.__override__, app_libdir: /data/data/com.rinart73.niceapp/lib nor in previously printed locations.
W/monodroid(13151): Trying to load sgen from: /data/data/com.rinart73.niceapp/files/.__override__/libmonosgen-2.0.so
W/monodroid(13151): Trying to load sgen from: /storage/emulated/0/Android/data/com.rinart73.niceapp/files/.__override__/libmonosgen-2.0.so
W/monodroid(13151): Trying to load sgen from: /data/data/com.rinart73.niceapp/lib/libmonosgen-2.0.so
W/monodroid(13151): Trying to load sgen from: /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-64bit-2.0.so
W/monodroid(13151): Trying to load sgen from: /system/lib64/libmonosgen-2.0.so
F/monodroid(13151): cannot find libmonosgen-2.0.so in override_dir: /data/data/com.rinart73.niceapp/files/.__override__, app_libdir: /data/data/com.rinart73.niceapp/lib nor in previously printed locations.

1 个答案:

答案 0 :(得分:2)

对我来说,解决方法是取消选中.csproj文件属性窗口的“ Android选项”部分中的“使用共享运行时”。

我假设此错误是在先前已安装其他Xamarin调试应用程序的设备上发生的。如果是这种情况,并且您选择“使用共享运行时”,则可能是您已经在设备上安装的Xamarin Runtime版本与应用程序所需的Xamarin Runtime版本不兼容。

我遇到了同样的问题,只是我的应用程序在一部手机上正常工作,而在另一部手机启动时崩溃。工作的手机是没有其他Xamarin调试应用程序的干净设备,因此必须在第一次安装正确的运行时。设备崩溃了,还安装了其他旧应用。

我希望这会有所帮助。