Installed Build Tools revision 33.0.0 is corrupted. Remove and install again using the SDK Manager.

﹏ヽ暗。殇╰゛Y 2024-04-01 18:13 203阅读 0赞

很多小伙伴安装好Android Studio后都会遇到如下报错:

  1. 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

  1. Task :prepareKotlinBuildScriptModel UP-TO-DATE
  2. Build-tool 33.0.0 is missing DX at D:\Programs\Android\sdk\build-tools\33.0.0\dx.bat
  3. 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

69690610428f4aab8aee4fd9e1bc5aa9.png

找到build tools目录中的lib/d8.jar,复制粘贴一份后将文件名修改为dx.jar

246c30472c82429785541d68d358a94d.png

重启Android Studio后即可解决问题。

发表评论

表情:
评论列表 (有 0 条评论,203人围观)

还没有评论,来说两句吧...

相关阅读