Android Could not determine artifacts for com.android.support:appcompat-v7:28.0.0: Skipped due to earlier error
导入项目报错,字面意思:无法确定com.android.support:appcompat-v7:28.0.0的工件:由于更早的错误而被跳过,应该是依赖的冲突问题,比如v7和v4的包冲突。
解决:
在当前module中的"build.gradle"文件中添加下面信息
/*
compile ('com.android.support:appcompat-v7:23.0.1'){
exclude module :'support-v4' //从v7中排除v4
}
*/
参考:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.0'
defaultConfig {
applicationId "com.bamboy.bamboycollected"
minSdkVersion 16
targetSdkVersion 28
versionCode 3
versionName "2.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile ('com.android.support:appcompat-v7:28.0.0'){
exclude module :'support-v4' //从v7中排除v4
}
compile 'com.android.support:recyclerview-v7:28.0.0'
}
将:
compile 'com.android.support:appcompat-v7:28.0.0'
改为:
compile ('com.android.support:appcompat-v7:28.0.0'){
exclude module :'support-v4' //从v7中排除v4
}