天天看點

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

文章目錄

  • ​​一、報錯資訊​​
  • ​​二、解決方案​​

一、報錯資訊

Android 應用編譯時 , 報如下錯誤 :

Build-tool 31.0.0 is missing DX at Y:\001_DevelopTools\002_Android_SDK\build-tools\31.0.0\dx.bat

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Installed Build Tools revision 31.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 43s      
【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

二、解決方案

點選頂部的 SDK Manager 圖示 , 打開 SDK Manager ;

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

打開後 , 選擇 SDK Tools 面闆 :

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

錯誤提示 Build Tools revision 31.0.0 出現錯誤 , 這裡先取消 編譯工具 31.0.0 版本勾選 , 選擇 Apply -> OK 解除安裝該工具 ;

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

提示删除該編譯工具的 31.0.0 版本 ,

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

删除中 …

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

删除完成 ;

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

然後再勾選 31.0.0 編譯工具 , 選擇 Apply -> OK 選項 ;

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

提示安裝 , 選擇 OK ;

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

等待該工具自動安裝完成 ;

【錯誤記錄】Android 編譯報錯 ( Installed Build Tools revision 31.0.0 is corrupted. Remove and install again )

安裝完成 , 選擇 Finish 選項 ;