【发布时间】:2018-12-15 13:02:16
【问题描述】:
新安装的 Android studio 3.1.3 在创建新项目并首次编译时出现奇怪的依赖错误。
类似的question 无助于解决问题。
事件日志:
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
屏幕截图:
这个问题在我身上发生了好几次,强制 https 或 http 也没有解决
【问题讨论】:
-
可以发布您的
build.gradle顶级和模块级别的文件吗? -
您的问题有什么解决方案吗?
-
您好,您是如何解决错误的?我看到您不接受以下任何答案。所以我尝试了下面提到的所有可能的解决方案,但没有一个对我有帮助。
-
@Lokesh 这是
com.android.support:appcompat-v7:28.0.0-alpha3中的一个错误,所以我将其更改为com.android.support:appcompat-v7:28.0.0它工作正常 -
@ZulqurnainJutt 我不确定。但我在受限的环境中工作。所以我只是在开放的互联网连接中运行所有内容。而且效果很好。
标签: android android-gradle-plugin build.gradle android-studio-3.0