英文:
gradle build fails on Android Studio : com.android.application cannot be found for any version
问题
When I do gradle build it gets stuck on this for a while:
执行gradle构建时,它会在这一步停滞一段时间:
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
启动Gradle守护进程,1个不兼容的守护进程无法重用,请使用--status查看详细信息
<-------------> 0% CONFIGURING [21s]
<-------------> 0% 正在配置 [21秒]
> root project > Resolve dependencies of detachedConfiguration1 > com.android.application.gradle.plugin-8.0.1.pom
> 根项目 > 解决detachedConfiguration1的依赖关系 > com.android.application.gradle.plugin-8.0.1.pom
and then it fails reporting:
然后它报告失败:
- What went wrong:
- 出了什么问题:
Plugin [id: 'com.android.application', version: '8.0.1', apply: false] was not found in any of the following sources:
插件[id:'com.android.application',版本:'8.0.1',apply:false]未在以下任何来源中找到:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Gradle核心插件(插件不在'org.gradle'命名空间中)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:8.0.1')
插件仓库(无法解决插件artifact 'com.android.application:com.android.application.gradle.plugin:8.0.1')
Searched in the following repositories:
在以下仓库中搜索:
Google
MavenRepo
Gradle Central Plugin Repository
I do can access from browser to https://mvnrepository.com/artifact/com.android.application/com.android.application.gradle.plugin/8.0.1 but I have noticed that even though I have no proxy enabled on my Android Studio, maven repository gives 403 if I check connection against it:
我可以从浏览器访问https://mvnrepository.com/artifact/com.android.application/com.android.application.gradle.plugin/8.0.1,但我注意到即使我在Android Studio上没有启用代理,maven仓库在我检查连接时返回403:
Any version of com.android.application would return the same error.
任何版本的com.android.application都会返回相同的错误。
I'm using Gradle 8.1.1, JDK 17, and Android Studio Hedgehog | 2023.1.1 Canary 3. Any help?
我正在使用Gradle 8.1.1,JDK 17和Android Studio Hedgehog | 2023.1.1 Canary 3。有什么帮助吗?
英文:
When I do gradle build it gets stuck on this for a while:
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
<-------------> 0% CONFIGURING [21s]
> root project > Resolve dependencies of detachedConfiguration1 > com.android.application.gradle.plugin-8.0.1.pom
and then it fails reporting:
* What went wrong:
Plugin [id: 'com.android.application', version: '8.0.1', apply: false] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:8.0.1')
Searched in the following repositories:
Google
MavenRepo
Gradle Central Plugin Repository
I do can access from browser to https://mvnrepository.com/artifact/com.android.application/com.android.application.gradle.plugin/8.0.1 but I have noticed that even though I have no proxy enabled on my Android Studio, maven repository gives 403 if I check connection against it:
Any version of com.android.application would return same error.
I'm using gradle 8.1.1, jdk17 and Android Studio Hedgehog | 2023.1.1 Canary 3. Any help?
答案1
得分: 0
I was having both a gradle installation and an skdman gradle installation. Basic installation had a minor version, while sdkman's was the one I needed. Evidently, there was a conflict between the two. I deleted everything from ~/.gradle dir and only used sdkman's gradle and now it works.
英文:
Solved it.
I was having both a gradle installation and an skdman gradle installation. Basic installation had a minor version, while sdkman's was the one I needed. Evidently, there was a conflict between the two. I deleted everything from ~/.gradle dir and only used sdkman's gradle and now it works.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论