【发布时间】:2019-08-09 06:12:44
【问题描述】:
我在 Android 上处于最新水平。刚启动一个新项目并在 Gradle Build with Pie (Android v9.0) 上出错:
无法解决依赖关系 ':app@debugAndroidTest/compileClasspath': 找不到任何版本 匹配 com.android.support:appcompat-v7:29.+.
这是我的build.gradle (Module:app):
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:29.+'
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'
}
接下来我该怎么做?
【问题讨论】:
-
Migrate to AndroidX 会解决这个问题
标签: android build.gradle android-support-library android-appcompat