Gradle Sync Failed,报错"could not find com.android.support:appcompat-v7:26.0.0-beta1"

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "wlanindoorpositioning.rollingisland.com.wlanindoorpositioning"
        minSdkVersion 14
        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.0.0-beta1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:0.5'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}

倒数第六行,“com.android.support:appcompat-v7:26.0.0-beta1”中将导入包限制为v7:26.0.0-beta1版本,而本地找不到该版本。将这行改为

    implementation 'com.android.support:appcompat-v7:26.+'

令项目自行匹配API 26中合适的版本即可

你可能感兴趣的:(Android)