0

I'm getting an error in my implementation 'com.android.support:appcompat-v7:28.0.0' at build.gradle file after implementing implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'

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'
}

I've already tried using

android.useAndroidX=true and
android.enableJetifier=true

Inside gradle.properties file but then I got another error in my MainActivity.kt file

Here's the error message :

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

Is there a way to fix this error? thank you!

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Miyuki Ouka
  • 25
  • 1
  • 6
  • 2
    Possible duplicate of [Can I use library that used android support with Androidx projects.](https://stackoverflow.com/questions/52033810/can-i-use-library-that-used-android-support-with-androidx-projects) – weegee Jun 23 '19 at 20:06

1 Answers1

0

AndroidX and Compat shouldn't be used together,AndroidX library was introduced to remove Compat Libraries. Turn off android.useAndroidX=false and android.enableJetifier=true Post your complete app gradle file. There is a library in your dependency that is using a version lower than your targetSdkVersion.

Jude Osbert K
  • 940
  • 9
  • 22