-2

I must be doing something extremely stupid, but I've been trying for several days and I'm at a loss. No matter what I do, I cannot get a "hello world" app to run on an Android emulator. I've even tried a clean install of Windows 10, clean install of VS 2015, and applying all updates (Windows, VS, SDK's, Xamarin). I've tried multiple API emulators (VS and AVD). I've tried processor settings on the VS emulators. I've tried turning off fast deploy and shared runtimes.

I've had so many different results (Marshmallow emulator hangs, debugger can't connect, app won't deploy) with the different settings. But in all cases where the app is successfully deployed to the emulator, the app starts and immediately crashes. The device logs are not particularly helpful (at least to me).

To be more specific: 1. I can create a new Android (blank) solution and can successfully deploy it to VS Kit Kat and Lollipop emulators. I can do this with both release and debug configurations. 2. When I attempt to run the app by clicking it in the emulator, it flashes the app screen and immediately stops.

My question is twofold: Is anyone else experiencing problems getting very basic Android apps to run with the latest version of VS 2015, VS Andriod Emulators, and Xamarin? And is there anything I can change in my configuration to resolve this problem?

Here is the build output:

InspectorDebugSession(0): StateChange: Start -> EntryPointBreakpointRegistered InspectorDebugSession(0): Constructed Android application is debugging. 01-04 08:07:09.024 I/art ( 1531): Late-enabling -Xcheck:jni 01-04 08:07:09.077 W/monodroid( 1531): Using override path: /data/data/App1.App1/files/.override 01-04 08:07:09.077 W/monodroid( 1531): Using override path: /storage/emulated/0/Android/data/App1.App1/files/.override 01-04 08:07:09.078 W/monodroid( 1531): Trying to load sgen from: /data/data/App1.App1/files/.override/libmonosgen-2.0.so 01-04 08:07:09.078 W/monodroid( 1531): Trying to load sgen from: /storage/emulated/0/Android/data/App1.App1/files/.override/libmonosgen-2.0.so 01-04 08:07:09.078 W/monodroid( 1531): Trying to load sgen from: /data/app/App1.App1-1/lib/x86/libmonosgen-2.0.so 01-04 08:07:09.092 W/monodroid( 1531): Trying to load sgen from: /data/data/App1.App1/files/.override/links/libmonosgen-2.0.so 01-04 08:07:09.093 W/monodroid-debug( 1531): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8815,server=y,embedding=1 01-04 08:07:09.217 W/monodroid-debug( 1531): Accepted stdout connection: 22 01-04 08:07:10.001 D/Mono ( 1531): Image addref mscorlib[0xacf1a340] -> mscorlib.dll[0xaf98be00]: 1 01-04 08:07:10.001 D/Mono ( 1531): AOT module 'mscorlib.dll.so' not found: dlopen failed: library "/data/app/App1.App1-1/lib/x86/libaot-mscorlib.dll.so" not found 01-04 08:07:10.001 D/Mono ( 1531): AOT module '/Users/builder/data/lanes/3511/501e63ce/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app/App1.App1-1/lib/x86/libaot-mscorlib.dll.so" not found 01-04 08:07:10.011 D/Mono ( 1531): Config attempting to parse: 'mscorlib.dll.config'. 01-04 08:07:10.011 D/Mono ( 1531): Config attempting to parse: '/Users/builder/data/lanes/3511/501e63ce/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/mscorlib/mscorlib.config'. Could not connect to the debugger. InspectorDebugSession(0): Disposed InspectorDebugSession(0): HandleTargetEvent: TargetExited

And here is the emulator device log. Again thanks in advance for your help. https://gist.github.com/screed01/8174a81dc5956a94ed2c549e9819b002

4

1 回答 1

0

我在安装 VS 2015 但没有删除旧的 Xamarin Studio 时遇到了这个问题。删除 XS 后,新的 VS 构建了我的应用程序,而不会失去与调试器的连接。

如果您想查看设备的特定日志,您可以执行以下操作:

查找亚行

转到 VS => SDK 位置 => Android SDK 位置中的首选项。在终端中执行 cd thislocation 。

大多数情况下,路径是这两个之一:

  1. cd /Users/用户名 /Library/Developer/ Xamarin /android-sdk-macosx/platform-tools
  2. cd ~/Library/Android/sdk/platform-tools

过滤日志

您可以使用此命令过滤日志标签。./adb logcat -s "YOURTAGNAME"

于 2017-01-03T08:25:53.183 回答