Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error building Xamarin.Android project with Google Play Services

I'm working on an Android project whose minimum target version is ICS, so I downloaded the Google Play Services ICS component (version 18.0.0.1) from the Xamarin component store. After adding references to the 4 dlls it contains, I was unable to build the project, so I had to adjust the target android versions in my project as mentioned in this thread. My current settings are:

Compile using Android version: API Level 17 Minimum Android to target: API Level 14 Target Android Version: API Level 17

However, the build process still fails with the following errors:

2>JAVAC : warning : com\google\ads\mediation\MediationBannerListener.class(com\google\ads\mediation:MediationBannerListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\ads\mediation\MediationBannerAdapter.class(com\google\ads\mediation:MediationBannerAdapter.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\ads\AdRequest.class(com\google\ads:AdRequest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\ads\AdRequest$ErrorCode.class(com\google\ads:AdRequest$ErrorCode.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\ads\mediation\MediationInterstitialListener.class(com\google\ads\mediation:MediationInterstitialListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\ads\mediation\MediationInterstitialAdapter.class(com\google\ads\mediation:MediationInterstitialAdapter.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\ads\mediation\customevent\CustomEventListener.class(com\google\ads\mediation\customevent:CustomEventListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\doubleclick\AppEventListener.class(com\google\android\gms\ads\doubleclick:AppEventListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\mediation\MediationBannerListener.class(com\google\android\gms\ads\mediation:MediationBannerListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\mediation\MediationBannerAdapter.class(com\google\android\gms\ads\mediation:MediationBannerAdapter.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\mediation\MediationInterstitialListener.class(com\google\android\gms\ads\mediation:MediationInterstitialListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\mediation\MediationInterstitialAdapter.class(com\google\android\gms\ads\mediation:MediationInterstitialAdapter.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\mediation\customevent\CustomEventListener.class(com\google\android\gms\ads\mediation\customevent:CustomEventListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\purchase\InAppPurchaseListener.class(com\google\android\gms\ads\purchase:InAppPurchaseListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\purchase\InAppPurchase.class(com\google\android\gms\ads\purchase:InAppPurchase.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\purchase\PlayStorePurchaseListener.class(com\google\android\gms\ads\purchase:PlayStorePurchaseListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\ads\purchase\InAppPurchaseResult.class(com\google\android\gms\ads\purchase:InAppPurchaseResult.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\cast\RemoteMediaPlayer.class(com\google\android\gms\cast:RemoteMediaPlayer.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\cast\RemoteMediaPlayer$OnMetadataUpdatedListener.class(com\google\android\gms\cast:RemoteMediaPlayer$OnMetadataUpdatedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\cast\Cast.class(com\google\android\gms\cast:Cast.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\cast\Cast$MessageReceivedCallback.class(com\google\android\gms\cast:Cast$MessageReceivedCallback.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\cast\RemoteMediaPlayer$OnStatusUpdatedListener.class(com\google\android\gms\cast:RemoteMediaPlayer$OnStatusUpdatedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\common\GooglePlayServicesClient.class(com\google\android\gms\common:GooglePlayServicesClient.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\common\GooglePlayServicesClient$OnConnectionFailedListener.class(com\google\android\gms\common:GooglePlayServicesClient$OnConnectionFailedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\common\ConnectionResult.class(com\google\android\gms\common:ConnectionResult.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\common\images\ImageManager.class(com\google\android\gms\common\images:ImageManager.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\common\images\ImageManager$OnImageLoadedListener.class(com\google\android\gms\common\images:ImageManager$OnImageLoadedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\drive\DriveFile.class(com\google\android\gms\drive:DriveFile.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\drive\DriveFile$DownloadProgressListener.class(com\google\android\gms\drive:DriveFile$DownloadProgressListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\drive\DriveResource.class(com\google\android\gms\drive:DriveResource.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\drive\events\DriveEvent.class(com\google\android\gms\drive\events:DriveEvent.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\drive\events\DriveEvent$Listener.class(com\google\android\gms\drive\events:DriveEvent$Listener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\common\internal\safeparcel\SafeParcelable.class(com\google\android\gms\common\internal\safeparcel:SafeParcelable.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\OnInvitationReceivedListener.class(com\google\android\gms\games\multiplayer:OnInvitationReceivedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\Invitation.class(com\google\android\gms\games\multiplayer:Invitation.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\realtime\RealTimeMessageReceivedListener.class(com\google\android\gms\games\multiplayer\realtime:RealTimeMessageReceivedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\realtime\RealTimeMessage.class(com\google\android\gms\games\multiplayer\realtime:RealTimeMessage.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\realtime\RoomStatusUpdateListener.class(com\google\android\gms\games\multiplayer\realtime:RoomStatusUpdateListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\realtime\Room.class(com\google\android\gms\games\multiplayer\realtime:Room.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\realtime\RoomUpdateListener.class(com\google\android\gms\games\multiplayer\realtime:RoomUpdateListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\turnbased\OnTurnBasedMatchUpdateReceivedListener.class(com\google\android\gms\games\multiplayer\turnbased:OnTurnBasedMatchUpdateReceivedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\multiplayer\turnbased\TurnBasedMatch.class(com\google\android\gms\games\multiplayer\turnbased:TurnBasedMatch.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\quest\QuestUpdateListener.class(com\google\android\gms\games\quest:QuestUpdateListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\quest\Quest.class(com\google\android\gms\games\quest:Quest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\request\OnRequestReceivedListener.class(com\google\android\gms\games\request:OnRequestReceivedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\games\request\GameRequest.class(com\google\android\gms\games\request:GameRequest.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\location\LocationClient.class(com\google\android\gms\location:LocationClient.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\location\LocationClient$OnAddGeofencesResultListener.class(com\google\android\gms\location:LocationClient$OnAddGeofencesResultListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\location\LocationClient$OnRemoveGeofencesResultListener.class(com\google\android\gms\location:LocationClient$OnRemoveGeofencesResultListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\location\LocationListener.class(com\google\android\gms\location:LocationListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap.class(com\google\android\gms\maps:GoogleMap.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnCameraChangeListener.class(com\google\android\gms\maps:GoogleMap$OnCameraChangeListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\model\CameraPosition.class(com\google\android\gms\maps\model:CameraPosition.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnIndoorStateChangeListener.class(com\google\android\gms\maps:GoogleMap$OnIndoorStateChangeListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\model\IndoorBuilding.class(com\google\android\gms\maps\model:IndoorBuilding.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnInfoWindowClickListener.class(com\google\android\gms\maps:GoogleMap$OnInfoWindowClickListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\model\Marker.class(com\google\android\gms\maps\model:Marker.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnMapClickListener.class(com\google\android\gms\maps:GoogleMap$OnMapClickListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\model\LatLng.class(com\google\android\gms\maps\model:LatLng.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnMapLongClickListener.class(com\google\android\gms\maps:GoogleMap$OnMapLongClickListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnMarkerClickListener.class(com\google\android\gms\maps:GoogleMap$OnMarkerClickListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnMarkerDragListener.class(com\google\android\gms\maps:GoogleMap$OnMarkerDragListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnMyLocationButtonClickListener.class(com\google\android\gms\maps:GoogleMap$OnMyLocationButtonClickListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\GoogleMap$OnMyLocationChangeListener.class(com\google\android\gms\maps:GoogleMap$OnMyLocationChangeListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\LocationSource.class(com\google\android\gms\maps:LocationSource.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\LocationSource$OnLocationChangedListener.class(com\google\android\gms\maps:LocationSource$OnLocationChangedListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\StreetViewPanorama.class(com\google\android\gms\maps:StreetViewPanorama.class): major version 51 is newer than 50, the highest major version supported by this compiler.
2>JAVAC : warning : com\google\android\gms\maps\StreetViewPanorama$OnStreetViewPanoramaCameraChangeListener.class(com\google\android\gms\maps:StreetViewPanorama$OnStreetViewPanoramaCameraChangeListener.class): major version 51 is newer than 50, the highest major version supported by this compiler.

Is this somehow related to the JDK version on my PC? Any ideas?

Thanks in advance.

like image 590
vbm Avatar asked Jul 21 '14 21:07

vbm


1 Answers

I was having a similar issue. From an android related stackoverflow reference I discovered that ' "Major version" means Java version. Java 7 = 51, Java 6 = 50. ' (Android Studio: what compiler settings when including Google Maps) . It is saying that the compiler it is using (in your case JDK 6) is not high enough.

First you want to make sure you have Java Development Kit for version 7 of Java installed. In my case it was already installed however the version 6 was still being used.

In Xamarin Studio, you can can go to Options/Preferences -> Projects -> SDK Locations to point to the JDK location for the version 7.

In Visual Studios with Xamarin Plugin I was unable to figure out how to specify to compile with JDK 7. I therefore deleted version 6 from my computer and now the code compiles.

like image 115
Sleepless Ninja Avatar answered Sep 30 '22 15:09

Sleepless Ninja