Xamarin安卓系统:应用程序崩溃(缺少libmonosgen-2.0.so)

rkue9o1l  于 2023-01-28  发布在  其他
关注(0)|答案(2)|浏览(215)

Xamarin工作室5.10.3(构建版本27)
设备:小米Mi4c(安卓系统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道格拉斯建议后的日志记录:

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.
gudnpqoy

gudnpqoy1#

对我来说,修复是取消勾选“使用共享运行时”在Android选项部分的.csproj文件的属性窗口。
我假设这个错误发生在之前安装了其他Xamarin调试应用程序的设备上。如果是这种情况,并且您选择了“使用共享运行时”,则可能是您已经安装在设备上的Xamarin运行时版本与应用程序所需的Xamarin运行时版本不兼容。
我遇到了同样的问题,只是我的应用程序在一部手机上运行正常,在另一部手机上启动时崩溃。运行应用程序的手机是一个干净的设备,没有其他Xamarin调试应用程序,因此第一次必须安装正确的运行时。设备崩溃时安装了其他旧应用程序。
希望这能帮上忙。

3zwjbxry

3zwjbxry2#

我知道这是一个较老的问题,但刚刚遇到它从Android 9更新到10。我不得不将Android包格式从“APK”改为“Bundle”。

相关问题