Android开发——错误:Error:Failed to resolve: com.android.support:appcompat-v7:28.+

版权声明:如转载请表明出处 https://blog.csdn.net/weixin_42247720/article/details/89446406

错误原因:

版本冲突

解决办法:

第一步:找到自己版本

File——>Settings——>Appearance & Behavior——>System Settings——>Updates

 小编版本26

第二步:更改工程SDK版本

打开工程的app文件里的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26        //更改为26,原28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.example.administrator.myproject"
        minSdkVersion 15
        targetSdkVersion 26    //更改为26,原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 {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'    //更改为v7:26.+ ,原28
    testCompile 'junit:junit:4.12'
}

解决问题,点击

完成版本更新

猜你喜欢

转载自blog.csdn.net/weixin_42247720/article/details/89446406