You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unity项目打包APK失败求助:Build Tools 33.0.0损坏问题

问题描述

Unity 2020.3.21 版本项目打包APK失败,因需提交Google Play Store更新,当前使用API Level 31。每次打包均触发「Build Tools 33.0.0损坏」报错,已通过Android Studio重新安装该版本但问题依旧。

报错信息

第一次报错日志:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl'.
> Installed Build Tools revision 33.0.0 is corrupted. Remove and install again using the SDK Manager.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with -

第二次报错日志:

Could not determine the dependencies of task ':unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl'.
> Installed Build Tools revision 33.0.0 is corrupted. Remove and install again using the SDK Manager.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
解决方案
  • 手动清理Build Tools残留文件

    1. 关闭Unity和Android Studio
    2. 找到Android SDK的Build Tools目录:Windows路径一般是C:\Users\[你的用户名]\AppData\Local\Android\Sdk\build-tools\33.0.0,Mac路径一般是~/Library/Android/sdk/build-tools/33.0.0
    3. 彻底删除整个33.0.0文件夹
    4. 重新打开Android Studio,通过SDK Manager重新安装Build Tools 33.0.0
  • 指定Unity使用的Build Tools版本

    1. 在Unity编辑器中打开Edit > Project Settings > Player > Android > Publishing Settings
    2. 展开Build选项,找到Build Tools Version,手动选择33.0.0(若下拉列表无该选项,点击Download重新下载)
  • 排查Google Mobile Ads插件兼容性

    1. 将项目中的Google Mobile Ads插件更新至兼容Unity 2020.3的最新版本
    2. 若更新后仍报错,可暂时回退到Build Tools 32.0.0(API Level 31可搭配该版本打包)
  • 清理Unity与Gradle缓存

    1. 在Unity中点击File > Build Settings > Android > Clean Build
    2. 删除Gradle缓存目录:Windows为C:\Users\[你的用户名]\.gradle\caches,Mac为~/.gradle/caches
    3. 重新尝试打包

内容的提问来源于stack exchange,提问作者Zain

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 15:25:18