Android_Studio Failed to resolve: com.android.support:appcompat-v7:29.错误解决

在安卓程序开发上面,按照教程设置了ActivityName等信息后点击编译出现Failed to resolve: com.android.support:appcompat-v7:29.错误,一看这个问题没有头绪,网上搜索看到一篇文章《Failed to resolve:com.android.support:appcompat-v7:报错处理》

感觉找到了问题所在,主要是系统SDK版本,系统版本设置太高,但是编译器版本较低。按照设置后

Android_Studio Failed to resolve: com.android.support:appcompat-v7:29.错误解决_第1张图片

Android_Studio Failed to resolve: com.android.support:appcompat-v7:29.错误解决_第2张图片

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26   //29改为26
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.example.helloworld"
        minSdkVersion 15
        targetSdkVersion 26 //29改为26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.+'  //29改为26
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

编译通过

Android_Studio Failed to resolve: com.android.support:appcompat-v7:29.错误解决_第3张图片

你可能感兴趣的:(Android)