Android Studio 一直拒绝解析 com.android.support :appcompat-v7:29. 0.1

标签 android android-gradle-plugin android-support-library android-appcompat androidx

我已经提到了this线程,但它不能解决我的问题。

我不断收到错误:ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1每次我尝试刷新 Gradle 时都在 Android Studio 中。

这是我的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.1"
    defaultConfig {
        applicationId "com.application.app"
        minSdkVersion 14
        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.1'
    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 模块的所有版本?我自己也找不到。

谢谢。

最佳答案

这是因为 com.android.support:appcompat-v7:29.x.x 不存在 .
您可以查看revision history在官方文档中。
你可以:

  • 使用支持库的最新 28.0.0 版本
  • 迁移到 androidx

  • Also check this note :

    Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.

    You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

    We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

    关于Android Studio 一直拒绝解析 com.android.support :appcompat-v7:29. 0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57209744/

    相关文章:

    android - 将 JSON 转换为游标

    macos - 无法在Android Studio项目中构建gradle

    android - 如何使 DrawerLayout 显示在工具栏下方?

    android - 放弃支持库 v7。我做错了什么?

    java - 在 Eclipse android.support 中构建 Android 项目无法解析为类型

    android - 如何检测设备是否能够调用和发送消息

    android - Google 刚刚向我收取了应用内测试购买费用,我该怎么办?

    java - 刷新或重绘 Fragment 的 View

    groovy - 如何使用Gradle同步两个文件夹?

    android - 是否可以根据另一种配置构建风格?