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

Sha*_*nny 12 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'
}
Run Code Online (Sandbox Code Playgroud)

构建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
}
Run Code Online (Sandbox Code Playgroud)

Bas*_*asi 13

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

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

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

有关更多 androidx 信息,请参阅