The Xamarin.Android and ProGuard issue

Image for post
Image for post

So from time to time, one would get some cryptic messages when trying to run an app on a physical device. They seem daunting at the beginning, but do not dispair; help is on the way!

The shock

I recently tried deploying a Xamarin.Android app to my side device, and to my surprise, got this error.

/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.2.0–7/lib/xbuild-frameworks/MonoAndroid/v7.1/]
(Can’t process class [android/app/ActivityTracker.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))
Image for post
Image for post
Tool exited with code 10 what!??

So, now what?
- Let’s start where we developers should always start: Google!

The answer

From the horse’s mouth:

If you are trying to use ProGuard against Android 7.0 or later, you must download a newer version of ProGuard because the Android SDK does not ship a new version that is compatible with JDK 1.8.

The solution

Follow the instructions in the following Stack Overflow answer, which involves:

  1. Downloading the latest version of ProGuard.

2. Replace the old version of ProGuard, typically located in /Users/[MyUser]/Library/Developer/Xamarin/android-sdk-macosx/tools/proguard with the folder you downloaded.

Image for post
Image for post

Et Voila! Deployment completed!

Written by

Techie, Tinkerer, Software Architect helping product teams create better software via lean startup and agile methodologies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store