Bug 52944 - JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
Summary: JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-03-01 21:32 UTC by smorsi27
Modified: 2017-06-30 05:45 UTC (History)
13 users (show)

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

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 FIXED

Description smorsi27 2017-03-01 21:32:04 UTC
I recently upgraded my project to the latest stable version of Xamarin.Forms and I'm having issues with getting my project to build. 

Here is my packages.config: 

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="AppsFlyerXamarinBindingAndroid" version="1.2.0" targetFramework="monoandroid70" />
  <package id="Bolts" version="1.4.0.1" targetFramework="monoandroid70" />
  <package id="ExifLib.PCL" version="1.0.1" targetFramework="monoandroid70" />
  <package id="Flurry.Analytics" version="2.0.0" targetFramework="monoandroid70" />
  <package id="HockeySDK.Xamarin" version="4.1.1" targetFramework="monoandroid70" />
  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="monoandroid70" />
  <package id="SQLitePCL.bundle_green" version="0.9.2" targetFramework="monoandroid70" />
  <package id="SQLitePCL.plugin.sqlite3.android" version="0.9.2" targetFramework="monoandroid70" />
  <package id="SQLitePCL.raw" version="0.9.2" targetFramework="monoandroid70" />
  <package id="urbanairship" version="4.0.1" targetFramework="monoandroid70" />
  <package id="Xam.Plugin.Media" version="1.0.3" targetFramework="monoandroid70" />
  <package id="Xam.Plugins.Forms.ImageCircle" version="1.8.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Compat" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Core.UI" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Core.Utils" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.CustomTabs" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Design" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Fragment" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Media.Compat" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Transition" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.v4" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.v7.AppCompat" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.v7.CardView" version="24.2.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.v7.MediaRouter" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.v7.Palette" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.v7.RecyclerView" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Android.Support.Vector.Drawable" version="25.1.1" targetFramework="monoandroid70" />
  <package id="Xamarin.Build.Download" version="0.4.2" targetFramework="monoandroid70" />
  <package id="Xamarin.Facebook.Android" version="4.16.1" targetFramework="monoandroid70" />
  <package id="Xamarin.FFImageLoading" version="2.2.5" targetFramework="monoandroid70" />
  <package id="Xamarin.FFImageLoading.Forms" version="2.2.5" targetFramework="monoandroid70" />
  <package id="Xamarin.Forms" version="2.3.3.193" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Ads" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Ads.Lite" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Base" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Basement" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Clearcut" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Gass" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Gcm" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Iid" version="42.1001.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Measurement" version="27.0.0.0" targetFramework="monoandroid70" />
  <package id="Xamarin.GooglePlayServices.Tasks" version="42.1001.0" targetFramework="monoandroid70" />
</packages>

Here's the stacktrace of the error I get: 

1>    Processing: C:\~~\obj\Debug\__library_projects__\Xamarin.Android.Support.v7.MediaRouter\library_project_imports\res\values-zu\values-zu.xml
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP
1>  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzpk;
1>  1 error; aborting
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2080,3): error : java.lang.IllegalArgumentException: already added :  Lcom/google/android/gms/internal/zzpk;

I'm not sure what is conflicting here. I'm sure there might be a duplicate package but I double checked and I have no duplicate packages in this project. Maybe there is one underneath hiding in a different package but I'm not sure. 

How can I properly fix this issue so that I can get my build working on latest version of Xamarin.Forms? (ver. 2.3.3.193)
Comment 1 Jimmy [MSFT] 2017-03-02 17:01:51 UTC
This does appear to be a conflict within the Google Play Services packages. Looking through the package.config, the immediate thing that sticks out is the "Xamarin.GooglePlayServices.Measurement" package which is at v. 27.0.0.0, much older than the other GPS packages.

Looking on NuGet[1], that package hasn't been updated past v. 29.0.0.2 and depends on the other GPS packages also being at v. 29.0.0.2. This may mean that it is no longer required or supported with newer versions.

Try removing that package from the project to see if it resolves the error. If you can't remove it because another package depends on it, the package manger output should indicate which package. Then look to see if there is an update to that other package that removes the dependency.

[1] https://www.nuget.org/packages/Xamarin.GooglePlayServices.Measurement
Comment 2 smorsi27 2017-03-02 19:25:57 UTC
removing Measurement package has resulted in me consistently getting the error: 

error MSB6006: "java.exe" exited with code 2.
Comment 3 smorsi27 2017-03-13 20:55:51 UTC
The issue I'm getting with the java.exe exited with code 2 is related to this post: https://forums.xamarin.com/discussion/86702/upgrading-from-java-1-7-to-1-8-causes-javac-warning-unknown-enum-constant-scope-library-group

I'm getting several: "JAVAC : warning : unknown enum constant Scope.LIBRARY_GROUP" errors in my build output after it fails. 

The forums discussion mentions upgrading to version 25 of the Android support libraries which I have done. The mentioned solution is to revert to ver. 24 which I might consider but has the Xamarin team looked into the issue with ver. 25 of the support libraries?
Comment 4 Jeremy Kolb 2017-03-16 15:45:59 UTC
I'm seeing this too with v25.1.1 of the support libraries.
Comment 5 smorsi27 2017-03-18 03:05:12 UTC
Looks like the only solution is multi-dex option to be enabled which has a bug when running on windows.
Comment 6 Jeremy Kolb 2017-03-20 17:14:35 UTC
See the following thread:

https://forums.xamarin.com/discussion/86702/upgrading-from-java-1-7-to-1-8-causes-javac-warning-unknown-enum-constant-scope-library-group

This appears to be an issue with the Android Support Libraries.
Comment 7 Jimmy [MSFT] 2017-04-24 18:35:55 UTC
Hey all, the Xamarin.Android.Support.Annotations package should resolve these warnings. Please try adding the package to your project and let us know if it helps. Thanks!

https://www.nuget.org/packages/Xamarin.Android.Support.Annotations/
Comment 8 Jimmy [MSFT] 2017-05-24 20:58:29 UTC
Based on the reports in the forum thread linked in comment 6 and there not being any new reports, it appears that this is resolved with the release of the Xamarin.Android.Support.Annotations package. The other support library packages have been updated to depend on this package so I am marking this report as resolved.
Comment 9 alex 2017-06-30 05:45:10 UTC
Got these warnings today  on latest stable VS for Mac (OS X)