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

2023-05-16

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

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

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'
}

编译通过

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android_Studio Failed to resolve: com.android.support:appcompat-v7:29.错误解决 的相关文章

随机推荐