为了账号安全,请及时绑定邮箱和手机立即绑定

所有依赖项都无法解决?

所有依赖项都无法解决?

达令说 2021-11-17 15:20:38
我的项目已正确构建并运行,但自从我更新了 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 回答

?
慕桂英4014372

TA贡献1871条经验 获得超13个赞

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


查看完整回答
反对 回复 2021-11-17
?
饮歌长啸

TA贡献1951条经验 获得超3个赞

在您的项目.gradle(不是应用模块一)中,您可能缺少 Google 存储库。这就是无法找到依赖项的原因。


buildscript {


    repositories {

        google() // <-- This is the line you must add

        jcenter()

    }

}


查看完整回答
反对 回复 2021-11-17
  • 2 回答
  • 0 关注
  • 231 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信