Android Studio 一直拒绝解析 com.android.support:appcompat-v7:29.0.1 [英] Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1

查看:30
本文介绍了Android Studio 一直拒绝解析 com.android.support:appcompat-v7:29.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经参考了这个线程,但它没有解决我的问题.

I have already referred to this thread but it does not resolve my issue.

我不断收到错误消息:错误:无法解析:com.android.support:appcompat-v7:29.0.1每次尝试刷新 Gradle 时都在 Android Studio 中.

I keep getting the error: ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1 in Android Studio every time I try to refresh Gradle.

这是我的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 模块的所有版本?我自己找不到.

How can I fix it and also is there a website where all the version of all the android modules are listed? I could not find any myself.

谢谢.

推荐答案

它发生是因为 com.android.support:appcompat-v7:29.xx 不存在.

您可以在官方文档中查看修订历史.

You can check the revision history in the official doc.

您可以:

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

另请查看此注释:

注意:随着 Android 9.0(API 级别 28)的发布,有一个名为 AndroidX 的新版本支持库,它是 Jetpack 的一部分.AndroidX 库包含现有的支持库,还包含最新的 Jetpack 组件.

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.

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

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.

我们建议在所有新项目中使用 AndroidX 库.您还应该考虑将现有项目迁移到 AndroidX.

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆