3

I'm following this tutorial: https://www.youtube.com/watch?v=xtElLuzjA0U

I'm using Android Studio 3.2.1 - Whenever I implement "implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'" I get this error:

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
 is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
 Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> 
element at AndroidManifest.xml:5:5-22:19 to override.

When I first did this tutorial, everything compiled and I was able to acquire the progress bar, but when I tried debugging and building, it crashed. Now, my second time around, implementing the dependency gives me the same error.

PS - I have it set to 4.4 - current android

I've looked at "https://developer.android.com/topic/libraries/support-library/packages" and when I cross reference, it seems I'm already including 28.0.0 - I'm not sure what to do from here.

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'

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'

/*third party  library*/
implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1'

}

What support does it need? I tried implementing tools:replace...But it just gives me a slew of errors.

neutJor
  • 55
  • 1
  • 8

2 Answers2

8

Its because your project has different versions of the same library - androidx and pre-androidx. In android studio tool bar go to: Refactor-> Migrate to androidX... -> Migrate

Guy Luz
  • 3,372
  • 20
  • 43
anber
  • 3,463
  • 6
  • 39
  • 68
2

These two lines automatically resolved my dependency conflicts

Add android.useAndroidX=true android.enableJetifier=true in your application gradle.properties file.

Rustam
  • 6,485
  • 1
  • 25
  • 25