我已经提到过this http://ttps://stackoverflow.com/questions/52997370/线程,但它不能解决我的问题。
我不断收到错误: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 模块的所有版本吗?我自己找不到。
Thanks.
发生这种情况是因为com.android.support:appcompat-v7:29.x.x
不存在.
您可以检查修订记录 https://developer.android.com/topic/libraries/support-library/revisions在官方文档中。
You can:
- 使用支持库的最新版本 28.0.0
- 迁移到androidx https://developer.android.com/jetpack/androidx/migrate
另请检查此注释 https://developer.android.com/topic/libraries/support-library/packages:
注意:随着 Android 9.0(API 级别 28)的发布,出现了一个名为 AndroidX 的新版本支持库,它是 Jetpack 的一部分。 AndroidX 库包含现有的支持库,还包括最新的 Jetpack 组件。
您可以继续使用支持库。历史工件(版本 27 及更早版本,并打包为 android.support.*)将在 Google Maven 上保留。但是,所有新库的开发都将发生在 AndroidX 库中。
我们建议在所有新项目中使用 AndroidX 库。您还应该考虑将现有项目迁移到 AndroidX。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)