问题描述
使用gradle编译Android程序,报如下错误:
Starting a Gradle Daemon (subsequent builds will be faster) Build-tool
32.0.0 is missing DX at /usr/local/android-sdk/build-tools/32.0.0/dx File /root/.android/repositories.cfg could not be loaded. Build-tool
32.0.0 is missing DX at /usr/local/android-sdk/build-tools/32.0.0/dxFAILURE: Build failed with an exception.
- What went wrong: Could not determine the dependencies of task ‘:app:compileReleaseJavaWithJavac’.
Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager.
解决方法
- 使用SDK Manager安装 BuildTools, 先到https://developer.android.google.cn/studio 下载commandlinetools:

- 解压该工具到ANDROID_HOME目录下,然后:

本文详细讲述了在使用Gradle编译Android程序时遇到的DX缺失问题,通过下载Command Line Tools、安装Build Tools 32.0.0并修复相关配置,最终解决了编译错误。
最低0.47元/天 解锁文章
3001

被折叠的 条评论
为什么被折叠?



