Xamarin sample application not displaying anything

放肆的年华 提交于 2019-12-23 17:40:28

问题


I meant to try out Xamarin.Android for a project of mine, so I installed Visual Studio 2015 and Xamarin.Android. I then installed the packages for the versions of Android I meant to use.

Now, I am trying to fire up TaskyAndroid, following this tutorial. At first, one of the two projects was skipped, which I fixed by babbling around the net. Now, if I start it in Debug, it launches the emulator and gives me this error:

Couldn't connect to logcat, GetProcessId returned: 0

I checked in the project properties, both projects of the solution are configured for Debug. I have Fast Deployment disabled and I allowed INTERNET and ACCESS_COARSE_LOCATION in the Android Manifest. The emulator displays a blank screen.

If I start it in Release mode (after changing the configuration), the emulator displays the same thing, without the aforementionned error.

EDIT: I have tried cleaning and rebuilding the solution. Deselecting "Use Shared Runtime" and reinstalling Xamarin didn't help either. I have tried hahing a look at the log, but I failed to muster any relevant information from it.


回答1:


There are several solutions in this thread. Please try:

  • Closing Emulator, Cleaning solution then Running solution worked for me. Or
  • Clean and Rebuild Or
  • Deselecting 'Use Shared Runtime' in Project Properties > Android Options > Packaging properties Or
  • Re-installing Xamarin emulator



回答2:


While I was dealing with the similar issue (just with the real device instead), I found that my Mono Shared Runtime, installed on my android device, was corrupted or something like that.

Was drilling the web for ages without any positive results about the exact solution that I actually found.

Go to your phone Setiings -> Apps -> Mono Shared Runtime -> Uninstall

With your next build and deploy, it will be reinstalled again and, hopefully, it will solve your problem as it did for me.

Edited: After a while, I found some more reasons which could silently prevent to deploy your app on device:

  • lack of space in your SD card
  • corrupted installations of your app with names like: yourProjName.yourProjName 0kb size


来源:https://stackoverflow.com/questions/36914487/xamarin-sample-application-not-displaying-anything

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!