2

I get a Xamarin error when compiling a new Android project. java\lang\Object.class major version 51 newer than 50, the highest major version supported by this compiler.

Anyone know the reason for this error and how to fix?

rici
  • 234,347
  • 28
  • 237
  • 341
hutch
  • 43
  • 1
  • 6
  • Without knowing more about your problem, I think the issue might be related to which JDK you are using. See [this](https://bugzilla.xamarin.com/show_bug.cgi?id=22966) for more information – buczek May 16 '16 at 16:07
  • http://stackoverflow.com/questions/24807117/android-studio-what-compiler-settings-when-including-google-maps pretty good explination – ClintL May 16 '16 at 23:39
  • the problem has gone away. I used NuGet to update all my Xamarin components in the Android project and now the app compiles ok. – hutch May 19 '16 at 12:09
  • in my case my android sdk manager was updated automatically to a newer version, i had to downgrade since my xamarin was up to date – Exlord Aug 08 '16 at 08:07

3 Answers3

2

the problem has gone away. I used NuGet to update all my Xamarin components in the Android project and now the app compiles ok.

hutch
  • 43
  • 1
  • 6
2

Another possibility if you are doing Xamarin in Visual Studio, make sure your JDK location is correct in Tools/Options/Xamarian/Android Settings. I found mine wasn't after upgrading the JDK.

tschlarm
  • 79
  • 1
  • 3
  • This helped me, in my case it was still pointing to the old jdk (1.6.x) so after installing the new one it had to be changed in visual studio to point to the new jdk(1.7.x) – DR. Sep 20 '16 at 11:08
1

This indicates that you are trying to execute a higher version of class files in a lower version of java. Check your java version.

You can check the version of jar file in which your jar file compiled by executing the following command.

javap -cp <jar-file> -v <classfile>
Shriram
  • 4,343
  • 8
  • 37
  • 64
  • the problem has gone away. I used NuGet to update all my Xamarin components in the Android project and now the app compiles ok. – hutch May 19 '16 at 12:09