Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Whenever the Multidex or Proguard option are enabled in a Xamarin.Android 7.0 project (using Java JDK 1.8) the following error appears during the build process, indicating a Java version mismatch:
>Error: Can't read [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar] (Can't process class [android/app/ActivityTracker.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) [CREATEMULTIDEXMAINDEXCLASSLIST]
The Proguard jar bundled with the Android SDK (<sdk-folder/tools/proguard/lib) hasn't been updated since 2011 since Proguard is now handled by the gradle plugin of Android Studio in Java based Android development. This outdated version of Proguard doesn't support Java 8.
Seems the mainDexClasses.bat script in the Android SDK build tools calls this outdated bundled Proguard jar and therefore breaks whenever it is used to handle projects using Java 8 (e.g. Xamarin.Android 7.0 projects)
A temporary solution is to download the latest version of Proguard ( https://sourceforge.net/projects/proguard/files/proguard/ ) and copy the contents of the zip to the <android-sdk-folder>/tools/proguard folder
It is being handled at https://github.com/xamarin/xamarin-android/pull/209
I have a Stack Overflow answer out there to help those who run into this:
I have the same issue, not yet solved.
Did this merge will be included to the next Xamarin.Android release ?
Bug still in Xamarin Android v184.108.40.206
I had download and replace the latest version of Proguard(5.3.1),but it still not work!
It does work. Check the android sdk folder you are using.
Thanks,clean and rebuild,id does work!
*** Bug 53242 has been marked as a duplicate of this bug. ***
The bug is still in the latest release of xamarin
## Status update
The latest preview version of Xamarin.Android 7.3 now bundles its own newer version of ProGuard  to work around this UPSTREAM issue in the Android SDK as shipped by Google. That new preview version is now available on Mac , and will tentatively be available for Visual Studio 2017 Preview within the next week or so.
Created attachment 22218 [details]
Test case, minimal
Correction to Comment 10: Xamarin.Android 7.3 is already included in the Xamarin 15.2 release , and that release is currently available for both Mac and Windows and both Visual Studio 2015 and Visual Studio 2017. Xamarin.Android 7.3 successfully uses its bundled version of ProGuard for the test case attached to this comment. I will accordingly mark Comment 10 as obsolete.
## Verification status: verified fixed in the Xamarin 15.2 Release
GOOD: XamarinVS 220.127.116.113 (c871575), Xamarin.Android 18.104.22.168 (448f54f) "15.2 Release" 
BAD: XamarinVS 22.214.171.124 (3f99c5a), Xamarin.Android 126.96.36.199 (b16fb82) "15.1 Release" 
## Steps followed to test
1. Ensure "Tools > Options > Xamarin > Android Settings > Java Development Kit Location" is set to Java JDK 8 (1.8).
2. Ensure the Android SDK location set under "Tools > Options > Xamarin > Android Settings > Android SDK Location" does _not_ included any spaces. This is necessary to avoid Bug 32861 (for ProGuard) and Bug 33052 (for multidex). Both of those bugs are relevant as of Xamarin.Android 188.8.131.52. For my tests I used the following location:
3. Build both of the projects in the attached test case in the Release configuration in Visual Studio. (The test projects are just new blank template apps with the ProGuard and multidex settings enabled.)
## GOOD results with Xamarin.Android 7.3
Both projects build successfully.
## BAD results with Xamarin.Android 7.2
### Excerpt from the diagnostic build output for the multidex test
> C:\android-sdk\build-tools\25.0.2\\mainDexClasses.bat --output obj\Release\multidex.keep "'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar';'C:\Program Files (x86)\MSBuild\Xamarin\Android\android-support-multidex.jar';'obj\Release\android\bin\classes'" (TaskId:230)
> CREATEMULTIDEXMAINDEXCLASSLIST : error : Can't read [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar] (Can't process class [android/app/ActivityTracker.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))
### Excerpt from the diagnostic build output for the ProGuard test
> ProGuard, version 4.7 (TaskId:229)
> Reading input... (TaskId:229)
> Reading program jar [C:\source\MinimalProguardTest\MinimalProguardTest\obj\Release\proguard\__proguard_input__.jar] (TaskId:229)
> Reading program jar [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar] (TaskId:229)
> java.io.IOException: Can't read [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\mono.android.jar] (Can't process class [android/app/ActivityTracker.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) (TaskId:229)
## Additional environment info (brief)
Java JDK 8u121 (1.8.0_121), 64-bit
Android SDK Tools 25.2.5
Android SDK Platform-tools 25.0.3
Android SDK Build-tools 25.0.2
Android 7.0 (API 24) SDK Platform Rev. 2
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Windows 10 (64-bit) version 1607 (OS Build 14393.1198)
US English locale, US Eastern time zone
note that in the case i originally reported (marked duplicated with this one), i already updated the proguard version manually (by replacing the version in the android sdk), i already have a folder without space for the android sdk, and i do not have the same error as the one you are describing (unsupported class version number [52.0]), error that is fixed by replacing proguard with the latest version.
Please have a look before marking it as duplicate or fixed.
Thanks for the heads-up. It looks like that bug report Bug 55268 is currently in the reopened status (thanks for adjusting that back in April too), so it will be eligible for further investigation by default. And indeed this bug report Bug 44187 can be considered to be focused only on the "unsupported class version number" error.
So for the purposes of this precise bug report Bug 44187, I will mark this bug as verified based on Comment 11, and further investigation related to ProGuard and multidex will proceed on the other bugs. Thanks!