java Lang UnsupportedClassVersion Error in Xamarin Studio

后端 未结 11 1828
终归单人心
终归单人心 2020-11-27 02:39

I am getting the following error when I am building my project . How do I correct this ?

C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.Android.Common.t

相关标签:
11条回答
  • 2020-11-27 03:27

    Download latest JDK and install,

    Then go to:

    • VS2015 Tools > Options > Xamarin and change the java to the latest JDK location.
    • Xamarin Studio: Tools -> Options -> SDK Locations

    Hope this helps.

    0 讨论(0)
  • 2020-11-27 03:29

    As Brendan Zagaeski told,its a problem generated because of using preview version of build tools

    Please follow these steps

    • Open SDK manager
    • Select Build tools with version 24rc2 (Please make sure that only this item is selected)
    • Click on uninstall

    UPDATE: detailed answer can be found here https://stackoverflow.com/a/37827161/5073734

    **UPDATE 2016 Nov ** Some of my friends told me that it can also happen with the nuget packages. If the above doesn't solve your problems, try to reinstall nuget packages.

    0 讨论(0)
  • 2020-11-27 03:30

    I realize this is a little bit older now, but I also ran into this issue and nothing I found online would resolve it. Finally I tried uninstalling and reinstalling some nuget packages I had installed (SQLite.Net). After that it compiled. Hope this is of use to someone who has exhausted these more common solutions.

    0 讨论(0)
  • 2020-11-27 03:31

    The version 52.0 here is referring to the specific release of the JDK, which in this case relates to JDK 8.

    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.

    The simplest option is to install the 64-bit version of JDK 1.8 since it is backwards compatible with all of the previous API levels and supports the new Android designer features.

    (One unfortunate complication with JDK 1.8 is that is not compatible with the outdated version of Proguard that is included in the Android SDK. Currently this will cause an error "Unsupported class version number [52.0]" when attempting to use the Proguard or Multidex features in Xamarin.Android. See 44187. I would recommend that you install this on the side of the default version that Android ships in android-sdk\tools\proguard. Simply rename the existing folder to something else and add the new version of proguard.)

    0 讨论(0)
  • 2020-11-27 03:32

    I faced the same problem just couple of minutes back. Sure shot solution: a) Go to Tools > Options > Xamarin > Android Settings > Java Development Kit Location > change it to JDK 1.8 Make sure you point to current java version

    100 % working

    0 讨论(0)
  • 2020-11-27 03:33

    Deleting version 24, downloading and installing JDK 1.8_112, changing the java development kit to JKD 1.8_112 (now found in program files and not program files x86) and rebuilding the project did the trick for me.

    0 讨论(0)
提交回复
热议问题