英文:
Bitrise build fails for Android 13 (API level 33)
问题
Bitrise在构建一个针对Android 13(API级别33)的应用时失败。
我已经在Bitrise堆栈上检查过,android-33只存在于linux-docker-android-20.04堆栈中。这对我来说不合适,因为我开发跨平台应用并使用依赖于macOS的其他堆栈。
是否有任何命令可以在bitrise.yaml中使用,以安装Android 33 API?我尝试查找Bitrise关于这个问题的指南,但没有找到。
这是来自Bitrise的错误信息:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Tooling.targets(100,5): error XA5207: 找不到API级别33的android.jar。这意味着API级别33的Android SDK平台未安装。要么在Android SDK管理器中安装它(工具 > 打开Android SDK管理器...),要么更改Xamarin.Android项目以针对已安装的API版本。(/usr/local/share/android-sdk/platforms/android-33/android.jar 不存在。)
英文:
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.)
答案1
得分: 1
android-sdk-update
步骤使用 已弃用的 sdk-tools,位于 /tools/ 文件夹,需要 Java 8 执行。假设您的 Bitrise 机器上的默认 Java 版本是 11。我的解决方案如下:
- 将 Java 版本设置为 8。
- 安装 build-tools 33.0.2(通过 android-sdk-update 步骤)。
- 将 Java 版本设置为 17(或您需要的版本)。
这似乎有点巧妙,但由于 android-sdk-update
步骤已经超过 6 年没有更新,我只是庆幸它仍然能够工作。
英文:
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:
- Set Java version to 8
- Install build-tools 33.0.2 (via the android-sdk-update step)
- Set Java version to 17 (or whatever version you need)
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论