赞
踩
很多小伙伴安装好Android Studio后都会遇到如下报错:
Installed Build Tools revision 33.0.0 is corrupted. Remove and install again using the SDK Manager.
即使按照提示去SDK Manager中重新安装build tools,也无法解决这个错误。
在Sync project with gradle files时,会收到如下warning
- Task :prepareKotlinBuildScriptModel UP-TO-DATE
- Build-tool 33.0.0 is missing DX at D:\Programs\Android\sdk\build-tools\33.0.0\dx.bat
- Build-tool 33.0.0 is missing DX at D:\Programs\Android\sdk\build-tools\33.0.0\dx.bat
这个warning说明build tools中缺少dx.bat这个批处理文件。
实际上是因为在31版本之后的build tools中,dx.bat被d8.bat替代了。
找到build tools目录中的d8.bat
,复制粘贴一份后将文件名修改为dx.bat
。
找到build tools目录中的lib/d8.jar
,复制粘贴一份后将文件名修改为dx.jar
。
重启Android Studio后即可解决问题。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。