【错误记录】Android Studio 编译报错 ( Could not find com.android.tools.build:gradle:4.2.1. )
文章目录
- 一、 报错信息
- 二、 解决方案
一、 报错信息
导入了一个 Eclipse 项目 , 编译后报如下错误 :
FAILURE: Build failed with an exception.* What went wrong:
A problem occurred configuring root project 'MidiSheetMusic_02'.
> Could not resolve all artifacts for configuration ':classpath'.> Could not find com.android.tools.build:gradle:4.2.1.Searched in the following locations:- https://jcenter.bintray.com/com/android/tools/build/gradle/4.2.1/gradle-4.2.1.pomIf the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.Required by:project :* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'MidiSheetMusic_02'.Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:4.2.1.
Searched in the following locations:- https://jcenter.bintray.com/com/android/tools/build/gradle/4.2.1/gradle-4.2.1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:project :* Get more help at https://help.gradle.orgBUILD FAILED in 1s
二、 解决方案
检查了下根目录下的 build.gradle 配置 , 发现只配置了 jcenter 仓库 ;
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {repositories {jcenter()}dependencies {classpath 'com.android.tools.build:gradle:4.2.1'}
}allprojects {repositories {jcenter()}
}
添加 google 仓库 和 mavenCentral 仓库 , 问题解决 ;
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {repositories {google()mavenCentral()jcenter()}dependencies {classpath 'com.android.tools.build:gradle:4.2.1'}
}allprojects {repositories {google()mavenCentral()jcenter()}
}
【错误记录】Android Studio 编译报错 ( Could not find com.android.tools.build:gradle:4.2.1. )相关推荐
- 【错误记录】Android Studio 编译报错 ( Could not determine java version from ‘11.0.8‘. ② | 升级 Gradle 版本 )
文章目录 一.报错信息 二.解决方案 解决 Could not determine java version from '11.0.8'. 问题 , 有两种方案 , 方案一 : Android Stu ...
- 【错误记录】Android Studio 编译报错 ( SDK location not found )
文章目录 一.报错信息 二.解决方案 一.报错信息 Android Studio 编译报错 : 首次打开别人的项目 , 经常性的报错 ; Could not determine the depende ...
- 【错误记录】Android Studio 编译报错 ( A problem occurred starting process ‘command ‘ninja.exe‘ ‘ )
文章目录 一.报错信息 二.解决方案 一.报错信息 Android Studio 编译报错 : FAILURE: Build failed with an exception.* What went ...
- 【错误记录】Android Studio 编译报错 ( Deprecated Gradle features were used in this build, making it incompat )
文章目录 一.报错信息 二.解决方案 一.报错信息 使用 Android Studio 编译比较老的 Android 项目时 , 报如下错误 : FAILURE: Build failed with ...
- 【错误记录】Android Studio 编译报错 ( Invalid Gradle JDK configuration found )
文章目录 一.报错信息 二.解决方案 一.报错信息 Android Studio 编译时提示 Invalid Gradle JDK configuration found 错误 ; 一般是打开一个新的 ...
- 【错误记录】Android Studio 编译报错 ( Error:Connection timed out: connect | 更新配置依赖仓库方式 )
文章目录 一.报错信息 二.解决方案 一.报错信息 编译 VirtualAppEx 源码时 , 报如下错误 : Gradle 'VirtualAppEx-master' project refresh ...
- 【错误记录】Android Studio 编译报错 ( Gradle 下载错误导致 Failed to open zip file 报错 )
文章目录 一.报错信息 二.解决方案 1.修改 gradle-wrapper.properties 配置 ( 失效解决方案 ) 2.手动干预 Gradle 目录 ( 推荐 ) 3.手动下载 Gradl ...
- 【错误记录】Android Studio 编译报错 ( Installed Build Tools revision 31.0.0 is corrupted )
文章目录 一.报错信息 二.解决方案 一.报错信息 Executing tasks: [:dex_demo:assembleDebug, :app:assembleDebug] in project ...
- 【错误记录】Kotlin 编译报错 ( Class ‘Xxx‘ is not abstract and does not implement abstract member )
文章目录 一.报错信息 二.解决方案 一.报错信息 Google Play 上架要求 Android 的编译版本 和 目标版本都要高于 30 才可以上传 ; 将 Android 的编译版本 和 目标版 ...
最新文章
- python太阳花绘图_python中turtle如何画太阳花?
- Outlook收不到邮件, 或者收邮件很慢, 怎么办?
- 【cocos2d-x】Lua中的table函数库
- Android深度探索(卷1)HAL与驱动开发读后感---第四章
- 一起学并发编程 - 钩子函数(shutdownHook)
- 乐器演奏_深度强化学习代理演奏的蛇
- cheetah的中文_cheetah是什么意思_cheetah的翻译_音标_读音_用法_例句_爱词霸在线词典...
- mysql内存数据库性能_Mysql内存表配置及性能测试
- 「雕爷学编程」Arduino动手做(19)—震动报警模块
- 项目分布式部署那些事(1):ONS消息队列、基于Redis的Session共享,开源共享
- Java基础Character类、Math类、Date类、DateFormat类、Calendar类
- jar 添加环境变量
- H3C网络故障排除方法
- 数据结构(Java)-树-堆排序的实现
- python 删除pdf页面_删除PDF其中几页的方法
- HTTP协议知识点总结
- 《52讲轻松搞定网络爬虫》读书笔记 - HTTP基本原理
- YouTube大转型:视频红人靠粉丝会员创收 不再依赖广告
- 双向链表插入、删除操作
- 如何系统学习计算机硬件和软件,怎么升级电脑硬件和软件