Bug 22966 - Getting a lot of warings and an error "major version 51 is newer than 50, the highest major version supported by this compiler" whe building
Summary: Getting a lot of warings and an error "major version 51 is newer than 50, the...
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-09-13 09:41 UTC by Miha Markic
Modified: 2015-07-08 15:04 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot Xamarin Studio - Warnings (488.81 KB, image/png)
2015-05-12 13:36 UTC, William
Details
Screenshot Xamarin Studio - About (112.53 KB, image/png)
2015-05-12 13:36 UTC, William
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Miha Markic 2014-09-13 09:41:42 UTC
Getting these errors (below) and similar warnings when building an empty Android Forms & Maps project
Forms 1.2.2.6234
Xamarin 4.16.0

First time I build I've got a stopping error. Then I deleted bin and obj folders, rebuild and got only warnings, no more errors. I reckon this has something to do with Xamarin using JDK6 instead of JDK7. 

Attached are sources without packages.


3>F:\Temp\TempProjects\App34\App34\App34.Android\obj\Debug\android\src\mono\com\google\android\gms\panorama\PanoramaClient_OnPanoramaInfoLoadedListenerImplementor.java(8,49): error :  package com.google.android.gms.panorama.PanoramaClient does not exist
3>F:\Temp\TempProjects\App34\App34\App34.Android\obj\Debug\android\src\mono\com\google\android\gms\panorama\PanoramaClient_OnPanoramaInfoLoadedListenerImplementor.java(8,49): error : 		com.google.android.gms.panorama.PanoramaClient.OnPanoramaInfoLoadedListener
3>F:\Temp\TempProjects\App34\App34\App34.Android\obj\Debug\android\src\mono\com\google\android\gms\panorama\PanoramaClient_OnPanoramaInfoLoadedListenerImplementor.java(8,49): error : warning: com\google\android\gms\plus\PlusClient.class(com\google\android\gms\plus:PlusClient.class): major version 51 is newer than 50, the highest major version supported by this compiler.
3>F:\Temp\TempProjects\App34\App34\App34.Android\obj\Debug\android\src\mono\com\google\android\gms\panorama\PanoramaClient_OnPanoramaInfoLoadedListenerImplementor.java(8,49): error : It is recommended that the compiler be upgraded.
...
3>  Note: Some input files use unchecked or unsafe operations.
3>  Note: Recompile with -Xlint:unchecked for details.
3>  1 error
3>  100 warnings
Comment 1 Arpit Jha 2014-09-17 06:18:54 UTC
I have checked this issue and unable to reproduce it.

I tried to reproduce it with the help of bug description and change java but unable to getting an error.You can follow the link it may help you

http://forums.xamarin.com/discussion/22102/javac-compiler-warning-when-using-google-play-service-component  

Could you please provide Sample project, environment info and build info. So that I can able to reproduce at my end.

Environment Info:
VS 2013 professional Update 3
XVS 3.5.58.0
Comment 2 William 2015-05-12 13:35:58 UTC
I am also getting these warnings, but I am not using maps or Xamarin.Forms. The cause of the issue for me is when I install app v4 support library. Easily reproducible: New Android project, add Xamarin.Android.Support.v4 NuGet package, and then build. It gets 24 warnings.
Comment 3 William 2015-05-12 13:36:32 UTC
Created attachment 11170 [details]
Screenshot Xamarin Studio - Warnings
Comment 4 William 2015-05-12 13:36:55 UTC
Created attachment 11171 [details]
Screenshot Xamarin Studio - About
Comment 5 William 2015-05-23 14:11:23 UTC
Any chance of a response on this, or should I make a new bug? In the repro situation, there are 24 warnings. In my project, there are even more. It hides all other warnings which are actually relevant.
Comment 6 Jonathan Pryor 2015-07-08 15:04:15 UTC
> I reckon this has something to do with Xamarin using JDK6 instead of JDK7.

You are absolutely correct: major version 51 corresponds to JDK7, while major version 50 is JDK6.

Rephrased: you're building your project with JDK6, but your project references libraries built with JDK7. The JDK6 compiler doesn't like that, and generates those warnings.

The fix is to update your JDK installation to at least JDK7.

If you re-run the Xamarin Installer, it should ensure that JDK7 is installed. Otherwise, you need to manually update the installed JDK.