我在我的应用程序的 android 库的 build.gradle 文件中看到一条错误消息。依赖 block 如下所示:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.beloo.widget:ChipsLayoutManager:0.3.7@aar'
}
我看到的消息是:
all com.android.support libraries must use the exact same version specification
显然,版本 27.0.2 和 21.0.3
Found versions 27.0.2, 21.0.3. Examples include com.android.support:animated-vector-drawable:27.0.2 and com.android.support:support-v4:21.0.3 less... (⌘F1)
最佳答案
覆盖旧的库
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.beloo.widget:ChipsLayoutManager:0.3.7@aar'
//overwrite old LIB
compile 'com.android.support:support-v4:27.0.2'
}
关于android - 不兼容的 gradle 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48593699/