androidxamarin.formscicdbitriseandroid-13

Bitrise build fails for Android 13 (API level 33)


Bitrise fails to build an Android app which targets Android 13 (API level 33).

I've checked on Bitrise stacks and android-33 is only present in linux-docker-android-20.04 stack. This is unsuitable for me as I develop cross-platform app and use the other stack which depends on macOS.

Is there any command which can be used in bitrise.yaml to install Android 33 API? I tried to find Bitrise guides on this case but found none.

Here is the the error from Bitrise:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Tooling.targets(100,5): error XA5207: Could not find android.jar for API level 33. This means the Android SDK platform for API level 33 is not installed. Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...), or change the Xamarin.Android project to target an API version that is installed. (/usr/local/share/android-sdk/platforms/android-33/android.jar missing.)

Solution

  • The android-sdk-update step uses the deprecated sdk-tools from the /tools/ folder which require Java 8 to run. Presumably the default Java Version on your Bitrise machine is 11. My solution was:

    1. Set Java version to 8
    2. Install build-tools 33.0.2 (via the android-sdk-update step)
    3. Set Java version to 17 (or whatever version you need)

    Bitrise workflow in order to install Android build-tools 33.0.2

    It seems hacky but since the android-sdk-update step hasn't been updated for more than 6 years, I'm just glad it somehow works.