所有依赖项都无法解决?

我的项目已正确构建并运行,但自从我更新了 Android Studio 后,它会出现这些错误……并且未选中离线工作。

错误


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:multidex:1.0.3. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:design:26.1.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:cardview-v7:26.1.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:recyclerview-v7:26.1.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:appcompat-v7:26.1.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support.constraint:constraint-layout:2.0.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:support-compat:26.1.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.github.ybq:Android-SpinKit:1.1.0. Open File Show Details



Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve > com.android.support:appcompat-v7:26.1.0. Open File Show Details



Failed to resolve: com.android.support.test:runner:1.0.2 Show in File Show in Project Structure dialog



Failed to resolve: com.android.support.test.espresso:espresso-core:3.0.2 Show in File Show in Project Structure dialog



Failed to resolve: com.android.support:multidex-instrumentation:1.0.2 Open File Show in Project Structure dialog



达令说
浏览 232回答 2
2回答

慕桂英4014372

我找到了......就像Yuenbe所说的那样添加jcenter()和google()......然后启动一个vpn然后构建项目

饮歌长啸

在您的项目.gradle(不是应用模块一)中,您可能缺少 Google 存储库。这就是无法找到依赖项的原因。buildscript {&nbsp; &nbsp; repositories {&nbsp; &nbsp; &nbsp; &nbsp; google() // <-- This is the line you must add&nbsp; &nbsp; &nbsp; &nbsp; jcenter()&nbsp; &nbsp; }}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java