无法解析';的依赖关系:app@debug/compileClasspath';:无法解析com.android。支持:设计:26.1.0

无法解析';的依赖关系:app@debug/compileClasspath';:无法解析com.android。支持:设计:26.1.0,android,android-studio,android-gradle-plugin,android-gradle-3.0,Android,Android Studio,Android Gradle Plugin,Android Gradle 3.0,我在同步gradle项目时遇到此错误 无法解析'的依赖项:app@debugAndroidTest/compileClasspath':无法解析com.android。支持:设计:26.1.0 有人能帮我吗 apply plugin: 'com.android.application' android { compileSdkVersion 26 defaultConfig { applicationId "com.example.phaniteja.sample1" minSd

我在同步gradle项目时遇到此错误

无法解析<代码>'的依赖项:app@debugAndroidTest/compileClasspath':无法解析com.android。支持:设计:26.1.0

有人能帮我吗

apply plugin: 'com.android.application' android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.phaniteja.sample1"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}  }   dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' }

无法解析的依赖项
:app@debugAndroidTest/compileClasspath':无法解析com.android。支持:设计:26.1.0
此问题通常发生在android Studio无法下载该依赖项时。这可能是由于许多原因造成的,比如我的例子中,
Maven2
jcenter
存储库在公司中被阻止。所以你能做的就是检查这个文件夹

Android sdk\extras\Android\m2repository\com\Android\support\appcompat-v7


并检查SDK中的所有可用版本,使用其中任何一个版本,因此studio将从SDK中获取该库,而不是从repository下载。

尝试添加您的Google maven repo。它对我有用##


@VishAdave立即检查出现此问题是因为studio无法从Maven2或jcenter下载支持库。确保在设置->生成,执行->渐变中禁用了脱机工作。@sunilsunny是的,仅禁用。该复选框未标记为脱机工作可能重复的
repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
}