I recently broke the Dalvik Limit (https://developer.android.com/studio/build/multidex.html) of 64K referencs as I started getting
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/ Xamarin.Android.Common.targets: Error: Tool exited with code: 2. Output: trouble writing output: Too many field references: 77369; max is 65536. You may try using --multi-dex option.
error after updating some nugets to MonoDroid 7.
When I turn on the MultiDex option in android settings and compile my project I get -
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 10. Output: Error: Can't read [/Library/Frameworks/Xamarin.Android.framework/Versions/7.0.1-3/lib/xbuild-frameworks/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))) (pjr.mob.android)
I can see BUGs relating to this -
https://bugzilla.xamarin.com/show_bug.cgi?id=44187
https://bugzilla.xamarin.com/show_bug.cgi?id=44013
https://bugzilla.xamarin.com/show_bug.cgi?id=33052
https://bugzilla.xamarin.com/show_bug.cgi?id=35491
It looks like I have to manually download and install ProGuard 5.X as detailed in these answers -
Xamarin.Android Proguard - Unsupported class version number 52.0
Xamarin Android ProGuard Enable
and overcome any issues that arise from this.
Yet, Xamarin Studio explicitly tells us in the (i) information box next to the proguard option is that it is not recommended to run proguard for a DEBUG build and that we should only run multidex after trying proguard first.
Will this mean we cannot debug effectively after enabling it? but I cannot DEBUG anyway (I cannot even run a release build even with the linker on which I thought might help) now without enabling it?
Is there some kind of Xamarin Support coming for this or do I need to look at somehow reducing the packages etc that we use (I am not sure I can do as most of it is Google Play Services related).
Any help is appreciated.
Other Info from Xamarin Studio Help > About
Java SDK: /usr java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)