Today I started to install Xamarin and create a pet project for myself. While doing so I faced a couple of issues and solved them using a couple of hints from SO which are worth sharing so other new starters like me can fix them quicker than me.
This happens specially using VS new > project > run
combination. You will see that it builds and everything is fine, however, the emulator starts and your application will appear/not appear at all and drop quickly afterwards. You will most likely get a message like:
And also you might face this message in console:
The latter is easy to fix, you just need to open the emulator settings dialog and clear the Use Fast Deployment
checkbox.
The former is happening because of a very stupid option inside hyper-v and you can fix it by opening the hyper-v and from device selection choose your emulator. After that click on settings and navigate to processor > Compatibility
, then tick the Migrate to a physical computer with a different processor version and you should be good to give it a go.
This one happened to me after running the universal Xamarin installer and finishing the steps in visual studio to create a new Xamarin forms project and click build.
By this time I was getting different error messages like:
or
or any of the following folders:
The reason (most probable) is failing in download a file called android_m2repository_r10.zip
from the google repository. However that is not always the case. For any reason the fix is completely the same.
Delete the versioned library folder that is giving you errors:
Mac Directory: /Users/[Username]/.local/share/Xamarin/{SUPPORT LIBRARY NAME}/{VERSION NUMBER}
Windows Directory: C:\Users\[Username]\AppData\Local\Xamarin\{SUPPORT LIBRARY NAME}\{VERSION NUMBER}
Rebuild your project (Which will kickoff a Build Task to re-download the library).
There are two steps to manually fixing this error.
m2repository
folder to the /content
folder..aar
contents to the /embedded
folder.You can follow the instruction mentioned on Xamarin troubleshooting guide here to fully resolve the issue.
However the short version is:
URL
of the missing m2repository downloadMD5
hash on the download URL from the given table{MD5HASH}.zip
(Where MD5HASH is the hashed download URL)Xamarin\zips
directoryHope this helps you save some time.