Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin - Unsupported class version number [52.0] (maximum 51.0, Java 1.7) #17

Closed
viktorbenei opened this issue Dec 5, 2016 · 3 comments

Comments

@viktorbenei
Copy link
Contributor

Bitrise Build Issue Report template

Description of the issue

Xamarin Android build failes with:

Error: Can't read [/Library/Frameworks/Xamarin.Android.framework/Versions/7.0.2-37/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)))
/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.2-37/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)))

Environment:

Where did the issue happen?

Xamarin Stable stack on bitrise.io

Which build Step causes the issue and which version of the step?

xamarin-builder@1.4.1

Build log

Relevant part of the xamarin-builder@1.4.1 step's log:

Error: Can't read [/Library/Frameworks/Xamarin.Android.framework/Versions/7.0.2-37/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)))
/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.2-37/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)))
@viktorbenei
Copy link
Contributor Author

viktorbenei commented Dec 5, 2016

This issue is related to a known Xamarin - ProGuard issue.

In the past the issue could be solved with adding a Script step (can be the first step in the workflow), with the content:

#!/bin/bash
set -ex

cd $ANDROID_HOME 
rm -rf build-tools/24.0.*
rm -rf platforms/android-24/

This script deletes the Android Build Tools v24.0.x and Android platform 24 directories from the Android SDK directory.

Depending on your situation this might still work, but as one of our users reported, this might no longer be enough to fix the issue.

An alternative solution is to upgrade ProGuard to the latest version. This can be done with a Script step, with the script content:

#!/bin/bash
set -ex

wget https://sourceforge.net/projects/proguard/files/latest/download?source=files -O proguard.zip
unzip -q proguard.zip
cd proguard*/
cp -R . $ANDROID_HOME/tools/proguard

@viktorbenei
Copy link
Contributor Author

More info & future discussion at: https://discuss.bitrise.io/t/proguard-failing-xamarin-android-build-unsupported-class-version-number/642

@b099l3
Copy link

b099l3 commented Apr 12, 2017

Thanks that fixed it for me, just had to make sure I ran the script step right before Xamarin archive step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants