gpt4 book ai didi

android - 无法解决 ':app@debug/compileClasspath' : Could not resolve 的依赖关系

转载 作者:IT老高 更新时间:2023-10-28 21:43:53 26 4
gpt4 key购买 nike

新安装的 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

屏幕截图:

TestProject

这个问题发生在我身上好几次了,强制 https 或 http 也没有解决它

最佳答案

您可能正在导入 Application 而不是 Module。好吧,你也可以在模块的 gradle 中更改它。

改变

apply plugin: 'com.android.application'

apply plugin: 'com.android.library'

您还需要从 gradle 中删除 applicationId

关于android - 无法解决 ':app@debug/compileClasspath' : Could not resolve 的依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51218535/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com