Android 梯度同步失败:无法解析';的依赖项:app@debug/compileClasspath';

Android 梯度同步失败:无法解析';的依赖项:app@debug/compileClasspath';,android,gradle,Android,Gradle,我们在Android Studio中创建了一个新项目,但我们的应用程序没有运行。(我们有最新版本的Android Studio和SDK) 您可以检查以下错误消息: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-rc02. Open File Show Details Unable to resol

我们在Android Studio中创建了一个新项目,但我们的应用程序没有运行。(我们有最新版本的Android Studio和SDK)

您可以检查以下错误消息:

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


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


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


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


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


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


Failed to resolve: com.android.support:appcompat-v7:28.0.0-rc02
Show in File
Show in Project Structure dialog


Failed to resolve: com.android.support.constraint:constraint-layout:1.1.3
Show in File
Show in Project Structure dialog
您可以在下面检查Build.gradle(位于项目根目录中):

问题在哪里?
我们如何解决这个问题?

主要是因为您的IP。是否在
文件->设置->构建和..
中启用了梯度脱机模式?如果是,请尝试禁用它。不幸的是,伊朗IP被AS阻止下载依赖项,这可能会导致此问题。脱机模式未启用。另外,我正在使用VPN。您是否也可以粘贴项目根目录的
Build.gradle
?哪个包含存储库?那太好了。看看能不能帮上忙ઽ૯ท 问题已更新。
    // Top-level build file where you can add configuration options common to all sub-projects/modules.

    buildscript {

        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.4'


            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
        }
    }

task clean(type: Delete) {
    delete rootProject.buildDir
}