-2

I am an android learner and I am stuck at one of the error and cannot find the solution to this. Actually, I did not understand the meaning of this error. How to fix this error?? If anyone could tell me I will be grateful. Thanks in advance

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.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:9:5-23:19 to override.

Basi
  • 3,009
  • 23
  • 28
  • Try this answer to troubleshoot your problem: https://stackoverflow.com/a/56784046/4377954 – Deˣ Jul 02 '19 at 05:39
  • you are using both androidx and support lib in your project, that's why you got this issue please migrate your project in androidx – Basi Jul 02 '19 at 06:03
  • check this for more info https://stackoverflow.com/questions/51280090/what-is-androidx/55849025#55849025 – Basi Jul 02 '19 at 06:04
  • I am making a clone application in android and for that, I am using some support library may I know which support library I should discard – Paritosh Purohit Jul 02 '19 at 06:09

3 Answers3

0

There is some attributes duplication with libs you are using. And error already shows the solution.

Just place below line in you manifest file's application tag.

tools:replace="android:appComponentFactory" 
DHAVAL A.
  • 2,251
  • 2
  • 12
  • 27
0

The only thing you have to is migrate to andoridx

Follow these steps:-

1) Click on refractor and choose, migrate to androidx.

2) Then it will automatically ask for backup and then do refractor.

hope it solves the problem.

karan sandhu
  • 171
  • 6
0

If you still facing the same problem you can try this code. Add these line in

<application......

tools:replace="android:appComponentFactory"

android:appComponentFactory="whateverString">

..... </application>

BlackBlind
  • 772
  • 9
  • 26