前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【错误记录】Android Studio 编译报错 ( Installed Build Tools revision 31.0.0 is corrupted )

【错误记录】Android Studio 编译报错 ( Installed Build Tools revision 31.0.0 is corrupted )

作者头像
韩曙亮
发布2023-03-30 09:08:36
9380
发布2023-03-30 09:08:36
举报
文章被收录于专栏:韩曙亮的移动开发专栏

文章目录

一、报错信息


代码语言:javascript
复制
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 为 如下属性 ,

代码语言:javascript
复制
android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"
}

创建 Module 时 , 生成的 build.gradle 为 如下属性 ,

代码语言:javascript
复制
android {
    compileSdkVersion 30
    buildToolsVersion "31.0.0"
}

将 buildToolsVersion 的版本 , 由

31.0.0

修改为

30.0.3

即可 ;

代码语言:javascript
复制
android {
    compileSdkVersion 30
    //buildToolsVersion "31.0.0"
    buildToolsVersion "30.0.3"
}

修改后 , 编译完成 ;

在这里插入图片描述
在这里插入图片描述

备选方案 : 按照

代码语言:javascript
复制
Remove and install again using the SDK Manager.

提示 , 卸载 Build-tool 31.0.0 并重新安装 ;

先卸载 , 再安装 ;

在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-12-07,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章目录
  • 一、报错信息
  • 二、解决方案
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档