【错误记录】Android Studio 编译报错 ( Installed Build Tools revision 31.0.0 is corrupted )
生活随笔
收集整理的這篇文章主要介紹了
【错误记录】Android Studio 编译报错 ( Installed Build Tools revision 31.0.0 is corrupted )
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
- 一、報錯信息
- 二、解決方案
一、報錯信息
Executing tasks: [:dex_demo:assembleDebug, :app:assembleDebug] in project Y:\002_WorkSpace\001_AS\ClassLoader_DemoAGPBI: {"kind":"warning","text":"Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories.\nThis repository is deprecated and it will be shut down in the future.\nSee http://developer.android.com/r/tools/jcenter-end-of-service for more information.\nCurrently detected usages in: root project 'ClassLoader_Demo', project ':app', project ':dex_demo'","sources":[{}]} Build-tool 31.0.0 is missing DX at Y:\001_DevelopTools\002_Android_SDK\build-tools\31.0.0\dx.bat Build-tool 31.0.0 is missing DX at Y:\001_DevelopTools\002_Android_SDK\build-tools\31.0.0\dx.batFAILURE: Build failed with an exception.* What went wrong: Could not determine the dependencies of task ':dex_demo: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.orgBUILD FAILED in 33s
二、解決方案
創建 Project 工程時 , 自動創建的 Module 其 build.gradle 為 如下屬性 ,
android {compileSdkVersion 30buildToolsVersion "30.0.3" }創建 Module 時 , 生成的 build.gradle 為 如下屬性 ,
android {compileSdkVersion 30buildToolsVersion "31.0.0" }將 buildToolsVersion 的版本 , 由 31.0.031.0.031.0.0 修改為 30.0.330.0.330.0.3 即可 ;
android {compileSdkVersion 30//buildToolsVersion "31.0.0"buildToolsVersion "30.0.3" }修改后 , 編譯完成 ;
備選方案 : 按照
Remove and install again using the SDK Manager.提示 , 卸載 Build-tool 31.0.0 并重新安裝 ;
先卸載 , 再安裝 ;
總結
以上是生活随笔為你收集整理的【错误记录】Android Studio 编译报错 ( Installed Build Tools revision 31.0.0 is corrupted )的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【开发环境】安装 Visual Stud
- 下一篇: 【Git】Git 基础命令 ( Git