文章目录
一、报错信息
二、解决方案
一、报错信息
Executing tasks: [:dex_demo:assembleDebug, :app:assembleDebug] in project Y:\002_WorkSpace\001_AS\ClassLoader_Demo AGPBI: {"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.bat FAILURE: 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.org BUILD FAILED in 33s
二、解决方案
创建 Project 工程时 , 自动创建的 Module 其 build.gradle 为 如下属性 ,
android { compileSdkVersion 30 buildToolsVersion "30.0.3" }
创建 Module 时 , 生成的 build.gradle 为 如下属性 ,
android { compileSdkVersion 30 buildToolsVersion "31.0.0" }
将 buildToolsVersion 的版本 , 由 31.0.0 31.0.031.0.0 修改为 30.0.3 30.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 并重新安装 ;
先卸载 , 再安装 ;