Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run Xamarin Android project

While trying to create and run the first Xamarin app with all the defaults, the build fails with the following error:

An unexpected error occurred trying to initialize Android Designer. 
Please verify the Android SDK path and the Java Development Kit path on 
Tools->Options->Xamarin->Android Settings menu. Please see the logs for more details.

I tried the solution suggested in How to resolve : unexpected error occured Initializing Android Designer" in VS 2015 with Xamarin. However, nothing seems to work.

like image 910
Gaurav Gahlot Avatar asked Sep 18 '16 16:09

Gaurav Gahlot


1 Answers

I was having the same problem. I have followed the link that you shared and successfully solved my environment. So I'll give some hints to make sure that all the necessary steps were made.

I was having the same error "An unexpected error occurred trying to initialize Android Designer. Please verify the Android SDK path and the Java Development Kit path on Tools->Options->Xamarin->Android Settings menu. Please see the logs for more details."

1) Go to Tools | Options | Xamarin | Other, and under Xamarin for Visual Studio Updates, Check now for STABLE updates. Make sure you're running at least 4.2.0.680. You will have to close Visual Studio in the background as the updater is running--it'll warn you. Uninstalling and installing the cross-platform development tools from Visual Studio was not applying this update for me. I had to force the issue.

To check Xamarion Version, you can follow the steps in the "Version information" section: https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/version-logs/

enter image description here

If you are using Windows and Visual Studio it will be : Help > About Microsoft Visual Studio > Copy Info [button]

2) Now, as mentioned earlier, go to Tools, Android SDK Manager. I noticed my "Android SDK Tools" and "Cross Platform Tools" were out of date and updates were available. I accepted and applied the updates to version 24.4.1. BEAR WITH ME, THIS IS WHERE IT GETS TRICKY--it still didn't work.

To check Android SDK Version, You can follow the steps in the "Android SDK Tools, Platform-tools, Build-tools" section: https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/version-logs/

If you are using Windows and Visual Studio it will be : Select the SDK Manager toolbar icon: enter image description here

3) It is important to repeat step 2, updating "Android SDK Tools" until you go at least version 25.2.5

enter image description here

After that all have worked for me. Please let me know if you have any further problem.

like image 189
mqueirozcorreia Avatar answered Sep 25 '22 00:09

mqueirozcorreia