7

I am attempting to run a Hello World example from the following tutorial: https://mva.microsoft.com/en-US/training-courses/xamarin-for-absolute-beginners-16182

I am receiving the following error:

Severityjava.lang.UnsupportedClassVersionError: com/android/dx/command/Main  :  Unsupported major.minor version 52.0    HelloXamarin.Droid          

I have tried many combinations of JRE/JDK versions. I am uninstalled them, reinstalled them. I have tried JDK 7 and JDK 8. I keep getting this same exact no matter what combination.

ollama
  • 157
  • 2
  • 5
  • 2
    Consult James Montemagno's Blog post on Fix for Unsupported major.minor version 52.0 : http://motzcod.es/post/149717060272/fix-for-unsupported-majorminor-version-520 – SushiHangover Sep 11 '16 at 00:57
  • 1
    Possible duplicate of [java Lang UnsupportedClassVersion Error in Xamarin Studio](http://stackoverflow.com/questions/36457947/java-lang-unsupportedclassversion-error-in-xamarin-studio) – Edvaldo Silva Jan 15 '17 at 16:22

4 Answers4

1

The solution not involving using Visual Studio IDE (i.e. build servers) is to import the following key to the registry after installing JDK version 1.8.0_101:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Novell\Mono for Android]
"JavaSdkDirectory"="C:\\Program Files (x86)\\Java\\jdk1.8.0_101"

Don't forget to clean/update sdks.cache files in obj[Release|Debug] directories to reference the correct version of jdk.

For the reference here is a complete list of paths used by Mono for Android:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Novell\Mono for Android]
"AndroidNdkDirectory"="C:\\ProgramData\\Microsoft\\AndroidNDK\\android-ndk-r11c"
"AndroidSdkDirectory"="C:\\Program Files (x86)\\Android\\android-sdk"
"JavaSdkDirectory"="C:\\Program Files (x86)\\Java\\jdk1.8.0_101"
too
  • 3,009
  • 4
  • 37
  • 51
1

I had a similar issue when Xamarin.Android project was moved from Xamarin Studio (Mac) to Visual Studio 2015 (Windows 10).

I resolved this issue after JDK 1.8.0_121 (for Widows x64) installation.

Vadzim Papko
  • 142
  • 1
  • 3
0

It worked also for me ONLY changing the registry entry

Luca V
  • 26
  • 6