0

I installed Xamarin from my visual studio 2015 and there was no error during the installation. When I tried to create an Android project in vs 2015 i got the error message in the screen shot below. This is my 3rd time of installing this. How can I correct this? Thanks.

enter image description here

Baba
  • 2,059
  • 8
  • 48
  • 81

3 Answers3

0

If you are targeting SDK 24 (Android 7.0 / Nougat) and you are using custom controls, you will need to install a 64-bit version of JDK 1.8+ as as mentioned here. Otherwise, the designer will not work due to an issue with the Android upstream.

After you have installed JDK 1.8+, make sure that Visual Studio / Xamarin Studio points to the right path which you can change that in the following places:

  • Xamarin Studio:
    • OS X: Preferences -> Projects -> SDK Locations -> Android SDK
    • Windows: Tools -> Options -> Projects -> SDK Locations -> Android SDK
  • Visual Studio: Tools -> Options -> Xamarin -> Android Settings -> Android SDK Location

If you didn't change the installation location for the JDK, the standard installation path is as follows:

  • OS X: /Library/Java/JavaVirtualMachines/jdk.jdk/Contents/Home
  • Windows: C:\Program Files\Java\jdk1.8.0_112\

Unfortunately, when upgrading to JDK 1.8+ will currently cause issues with ProGuard, as the Android SDK ships an deprecated version as read here. The error you are most likely to retrieve when compiling your Android project is:

Unsupported class version number [52.0] (maximum 51.0, Java 1.7)

To resolve this issue, simply follow this guide.

As a last thing, make sure that your packages in the Android SDK is up to date as well.

Community
  • 1
  • 1
Demitrian
  • 3,200
  • 1
  • 24
  • 41
  • Thanks. The solution above worked for me. However, the Icons in the Toolbox for the designer are broken and dont show very well but the names of the controls are visible. – Baba Jan 09 '17 at 03:09
  • Sounds like an issue with the designer when targeting SDK 24. In that regard, I think it'd be sensible to [reach out to Xamarin](https://bugzilla.xamarin.com). – Demitrian Jan 09 '17 at 07:32
0

Make sure that VS is using the new version that you have installed.

Visual Studio Tools -> Options -> Xamarin

enter image description here

CharithJ
  • 46,289
  • 20
  • 116
  • 131
0

Open Android SDK Manager from visual studio and it will preselect the updates for you. Just click install packages button on the bottom right. After installation close it and open SDK manager again and install updates again. Do this multiple times untill the version you are looking for is installed. I was on version 23 so i repeated the steps twice to install version 25 SDK Update

ziaprog
  • 1,497
  • 1
  • 10
  • 11