我的项目已正确构建并运行,但自从我更新了 Android Studio 后,它会出现这些错误……并且未选中离线工作。错误Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:multidex:1.0.3. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:design:26.1.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:cardview-v7:26.1.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:recyclerview-v7:26.1.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:appcompat-v7:26.1.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support.constraint:constraint-layout:2.0.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:support-compat:26.1.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.github.ybq:Android-SpinKit:1.1.0. Open File Show DetailsUnable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:appcompat-v7:26.1.0. Open File Show DetailsFailed to resolve: com.android.support.test:runner:1.0.2 Show in File Show in Project Structure dialogFailed to resolve: com.android.support.test.espresso:espresso-core:3.0.2 Show in File Show in Project Structure dialogFailed to resolve: com.android.support:multidex-instrumentation:1.0.2 Open File Show in Project Structure dialog
2 回答
饮歌长啸
TA贡献1951条经验 获得超3个赞
在您的项目.gradle(不是应用模块一)中,您可能缺少 Google 存储库。这就是无法找到依赖项的原因。
buildscript {
repositories {
google() // <-- This is the line you must add
jcenter()
}
}
添加回答
举报
0/150
提交
取消