用于Android的Visual Studio模拟器无法正常工作:找不到mscorlib.dll.so

时间:2016-03-25 09:45:55

标签: android xamarin android-emulator visual-studio-2015 visual-studio-emulator

配置Hyper-V并设法获取running后,Visual Studio Emulator for Android正在启动。我可以看到我的启动画面,但随后该应用程序退出。这是输出日志:

InspectorDebugSession(1): StateChange: Start -> EntryPointBreakpointRegistered
InspectorDebugSession(1): Constructed
Android application is debugging.
03-25 10:24:48.717 D/dalvikvm( 1251): Late-enabling CheckJNI
03-25 10:24:48.749 D/dalvikvm( 1251): Trying to load lib /data/app-lib/MyApp.Droid-1/libmonodroid.so 0xa8f89c78
03-25 10:24:48.749 D/dalvikvm( 1251): Added shared lib /data/app-lib/MyApp.Droid-1/libmonodroid.so 0xa8f89c78
03-25 10:24:48.761 W/monodroid( 1251): Using override path: /data/data/MyApp.Droid/files/.__override__
03-25 10:24:48.761 W/monodroid( 1251): Using override path: /storage/emulated/0/Android/data/MyApp.Droid/files/.__override__
03-25 10:24:48.761 W/monodroid( 1251): Trying to load sgen from: /data/data/MyApp.Droid/files/.__override__/libmonosgen-2.0.so
03-25 10:24:48.761 W/monodroid( 1251): Trying to load sgen from: /storage/emulated/0/Android/data/MyApp.Droid/files/.__override__/libmonosgen-2.0.so
03-25 10:24:48.761 W/monodroid( 1251): Trying to load sgen from: /data/app-lib/MyApp.Droid-1/libmonosgen-2.0.so
03-25 10:24:48.761 W/monodroid( 1251): Trying to load sgen from: /data/data/MyApp.Droid/files/.__override__/links/libmonosgen-2.0.so
03-25 10:24:48.761 W/monodroid-debug( 1251): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8915,server=y,embedding=1
03-25 10:24:48.917 W/monodroid-debug( 1251): Accepted stdout connection: 43
03-25 10:24:49.693 D/Mono    ( 1251): Image addref mscorlib[0xb948bb30] -> mscorlib.dll[0xb948b0f0]: 1
03-25 10:24:49.697 D/Mono    ( 1251): AOT module 'mscorlib.dll.so' not found: dlopen failed: library "/data/app-lib/MyApp.Droid-1/libaot-mscorlib.dll.so" not found
03-25 10:24:49.697 D/Mono    ( 1251): AOT module '/Users/builder/data/lanes/2970/46c3f7e0/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app-lib/MyApp.Droid-1/libaot-mscorlib.dll.so" not found
03-25 10:24:49.705 D/Mono    ( 1251): Unloading image data-0x95e99010 [0xb948bb90].
Could not connect to the debugger.
InspectorDebugSession(1): HandleTargetEvent: TargetExited
InspectorDebugSession(1): Disposed

我试图在模拟器中卸载数据(app,mono,xamarin),重新启动Visual Studio /模拟器,但没有任何帮助。使用Android模拟器时为什么会这么痛苦?如果没有任何模拟器无法在" production"中使用,那就不知道如何开发Android应用程序。

我应该提一下,它适用于设备和其他模拟器,如Xamarin Android Player,Android SDK模拟器,......

1 个答案:

答案 0 :(得分:6)

尝试一下: Xamarin Forms Android App Crashes Running Debug with VS Android Emulator

简而言之:

<强> 1。 &#34;无法连接到调试器&#34;问题:

  1. 启动Hyper-V管理器
  2. 选择您要使用的模拟器
  3. 右键单击,点击设置
  4. 点击处理器
  5. 点击兼容性
  6. 设置复选框“迁移到具有不同处理器版本的物理计算机”
  7. <强> 2。缺少的libaot-mscorlib.dll.so问题:

    转到Android项目的属性,点击“Android选项”标签,然后取消选中“使用快速部署”。