2

I've recently installed Visual Studio with Xamarin.

When I want to run even not modified app, I'm getting error

java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0

Screenshoot of SDK manager: SDK manager

From android 7.0 (API 24) theres nothing installed.

When I remove this Android SDK Build tools 24.0.3 I get just "Deploy failed" without any error information.

Seems like Visual Studio is still trying to use the 24 API version. Should I switch to API version 23? If yes, how can I do it?

allin0n3
  • 157
  • 1
  • 4
  • 13
  • 1
    Possible duplicate of [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](http://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – Paul Oct 05 '16 at 16:59
  • 2
    Possible duplicate of [java Lang UnsupportedClassVersion Error in Xamarin Studio](http://stackoverflow.com/questions/36457947/java-lang-unsupportedclassversion-error-in-xamarin-studio) – Alan Clark Oct 05 '16 at 17:05

2 Answers2

6

You'll have to install the Java JDK 1.8. I would suggest removing 1.7 unless you need to use previous versions. The release notes for Xamarin.Android 7.0 have more information as well: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.0/

Note: Xamarin.Android 7.0 requires JDK 1.8 to use the Android Nougat (API 24) APIs. You can continue to use earlier versions of the JDK if targeting earlier Android API levels:

JDK 1.8 - up to API 24+ JDK 1.7 - up to API 23 JDK 1.6 - up to API 20 Additionally, a 64-bit version of the JDK is required to use custom controls in the Android designer.

therealjohn
  • 2,378
  • 3
  • 23
  • 39
  • Thank you for response. I did what you said. This might help others. What I did was running Genymotion, then Visual Studio automatically saw and and let me run my app directly on external emulator. – allin0n3 Oct 05 '16 at 18:40
0

Download and install JDK 1.8.. and change the path.. it will be work...

PrabhuPrakash
  • 261
  • 2
  • 7