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 v18.104.22.168
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. ***