0

I have tried all the solutions on multiple websites and nothing seems to fix it. This is the error I receive every time I try to run it. I've been trying to fix it for over a week now.

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:21:5-50:19 to override.

I've tried adding:

tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"
  • I've tried switching to AndroidX

  • I've tried cleaning project/invalidate cache and restart.

  • I've tried changing sdk version

  • I've tried any answer you'll link me to that answers this question already

Manifest file build.gradle

I expect the project to run, but every time I attempt I get the same error, even when following its suggestions

J. Rafko
  • 3
  • 2
  • 1
    You are using androidx and support libraries together. You can't do it. Post your build.gradle file – Gabriele Mariotti Aug 27 '19 at 21:51
  • IOW, your problem is not in your manifest, but in your `build.gradle` file and your chosen set of dependencies. If you edit your question and provide your module's `build.gradle` file, perhaps we can identify the conflict there. Otherwise, run a Gradle dependency report and see where you are getting a mix of `com.android.support` and `androidx` dependencies from. – CommonsWare Aug 27 '19 at 21:52
  • I updated and added my build.gradle. What could the dependency issue be? How would I run a dependency report? – J. Rafko Aug 27 '19 at 21:54
  • In the future, please include things like the manifest file and Gradle build file as text in the question, not as images on a third-party site. "What could the dependency issue be?" -- one of the Firebase libraries must be set up to use AndroidX. Everything else that you have is using the older Android Support Library. Since that code is no longer maintained, you should consider upgrading everything to AndroidX, replacing all those `com.android.support` libraries with `androidx` equivalents. – CommonsWare Aug 27 '19 at 22:13

2 Answers2

0

I had similar problem. Added two lines in gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

These two lines automatically resolved my dependency conflicts between google's files and third party dependencies.

0

Your code are fine. The issue is that you can't use a tool function without using

"xmlns:tools="http://schemas.android.com/tools". Why don't you add this line in your manifest.

right after your "Application" like this:

<Application xmlns:tools="http://schemas.android.com/tools"

"then as usual" you can start using the tool function you will be able to use it.

I hope this should resolve your issue.

Wade
  • 45
  • 12
  • Hey, my bad I didn't see that you have already added the Tool function in it. Let me asked you something, the Dependencies which you have Implemented is all the "jar" file are in the "libs" folder of the Android application???? if not you might want to add it without that you will not be able to use the dependencies which you have implemented. – Wade Aug 31 '19 at 17:30