Reputation: 143
I am trying to add ramotion paper onboarding android, and having the following problem
in my app gradle I have this
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.ramotion.paperonboarding:paper-onboarding:1.1.3'
but I'm getting this error
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-19:19 to override.
Upvotes: 0
Views: 190
Reputation: 1219
I hope this will work for you
You have to migrate android.support to androidx to use com.google.android.material.libraries
android.useAndroidX=true
android.enableJetifier=true
Add above lines in gradle.properties file.
Migrate to Android X by using following way
Go to Refactor---> Migrate to AndroidX ---> click on Migrate button and do refractor.
And import your classes and XML from androidx packages.
for example
Activity :
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Upvotes: 1
Reputation: 329
I think your library is using androidx and it has the same dependencies as your current project(your project is using old dependencies, it means dependencies previous to androidX). When it tries to merge it launch a conflict because it has different sources from the same dependency. I suggest to update your dependencies of your project to Androidx :)
Upvotes: 0