错误:无法解决:com.android.support:appcompat-v7:29.0.0

时间:2019-06-16 15:28:33

标签: android gradle

  
    

我已经安装了android 3.4.1,之后我正在设置android sdk 29     之后停止并显示此错误。

  

错误:无法解决:com.android.support:appcompat-v7:29.0.0 你能帮我吗

  

构建gradle模块       应用插件:“ com.android.application”

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.example.testing"
        minSdkVersion 15
        targetSdkVersion 29
        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:29.0.0'
    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'
}
  

建立gardle项目

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:2)

随着Android 9.0 (API level 28)的发布,AndroidX的支持库有了一个新版本,它是Jetpack的一部分。

支持库版本28.0.0将是android.support包装下的最后一个功能版本,鼓励开发人员迁移到AndroidX

您可以继续使用支持库。历史工件(那些版本为27和更早版本,并打包为android.support.*的工件)将在Google Maven上可用。但是,所有新的库开发都将在AndroidX库中进行。

有关androidx的更多信息,请参阅this