首页 > 解决方案 > 无法同步 gradle android studio 3.1.4

问题描述

我用 gradle 4.4 安装了 android studio 3.1.4 但我无法同步它,我阅读了所有关于同步的主题,但我从所有依赖项中得到了错误,我添加了 maven 链接,mavencentral,通过编译更改实现但没有任何效果

这些是错误:

无法解析 ':app@debugAndroidTest/compileClasspath' 的依赖关系:无法解析 com.android.support.test:runner:1.0.1。

无法解析 ':app@debugAndroidTest/compileClasspath' 的依赖关系:无法解析 com.android.support.test.espresso:espresso-core:3.0.1。

无法解析 ':app@releaseUnitTest/compileClasspath' 的依赖关系:无法解析 com.android.support:appcompat-v7:28.0.0-rc01。

无法解析 ':app@releaseUnitTest/compileClasspath' 的依赖关系:无法解析 com.android.support.constraint:constraint-layout:1.1.2。

这是我的 gradle.build :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "comcooking.wikiyar.myapplication"
        minSdkVersion 17
        targetSdkVersion 28
        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:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.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'
}

标签: javaandroidxmlandroid-studio-3.1.4

解决方案


推荐阅读