在build.gradle中实现MaterialProgressBar时,Appcompat Dependencies



在实现implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'后,我在build.gradle文件的implementation 'com.android.support:appcompat-v7:28.0.0'中出现错误

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'
    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.useAndroidX=true and
android.enableJetifier=true

gradle.properties文件中,但随后我的 MainActivity.kt 文件中出现了另一个错误

这是错误消息:

Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='cardview-v7', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.lifecycle', myArtifactId='lifecycle-viewmodel', myVersion='2.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies less... (Ctrl+F1) 
Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).  Issue id: GradleCompatible

有没有办法修复此错误?谢谢!

AndroidX和Compat不应该一起使用,AndroidX库被引入以删除Compat库。关闭 android.useAndroidX=false and android.enableJetifier=true发布完整的应用分级文件。依赖项中有一个库使用的版本低于 targetSdkVersion。

相关内容

最新更新