I am using dagger2 in my app. But when I started project my activities was extended support AppcompatActivity.Now while build I am getting warning via butterknife.
API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
To fix this I must upgrade butterknife version from 9.0.0-rc1 to 10.2.0 when I change version butterknife to 10.2.0 I am getting error to build.Because I am not using androidx. error like this:
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-70:19 to override.
So I don't know how to fix this issue.If somebody had such kind of error and warning please help me if you fixed it
Migrate your project to AndroidX, butterknife 10.2.0 is on androidX.
It literally says what you need to do. Add tools:replace="android:appComponentFactory" like this: <application tools:replace="android:appComponentFactory"
Related
I have a library that needs to do login via azure , when I try to implement msal to it 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 element at AndroidManifest.xml:13:5-46:19 to override.
From my understanding (correct me if i'm wrong) it is caused because msal is using androidx and my main project is using android support ,
I can't migrate my project to androidx , any way to fix this issue ?
Many thanks!
Merging Errors: Error: Attribute application#appComponentFactory value=(androidx.core.app.CoreComponentFactory) from AndroidManifest.xml:22:18-86 is also present at AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:39:5-738:19 to override.
in android 28.0.3 i want solution without migrating androidx. thanks in advance.
As it's suggested why you don't add
android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
tools:replace="android:appComponentFactory"
to mainfest application tag.and if you want to use suport library rather than androidx please don't try to use libraries that use androidx.
I tried in the past to integrate Google AdMob in my application, and it worked. Now, when I try to rebuild the code, it ends up with an error I don't surely know what is it all about.
I wanted an implementation of a Banner Ad, but it ended up showing this in the build output section:
**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:10:5-34:19 to override.
**
You need to fully move to AndroidX.
The new Google AdMob libraries are all for AndroidX, not for support libraries prior 28.0.0.
I'm using react native and my Android project isn't compiling anymore because of 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.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:28:5-109:19 to override.
I've tried to add that tag but I'm getting always errors!!
I've tried to remove all packages to find which had androidX support or how to fix this bug, but I've been stuck for days!
Thanks!
UPDATE
I've opened all gradle files of the libraries and one at the time I've checked the dependencies, excluding or changing the version of some.
A terrible work but now I'm able to compile...
Thanks to all!
This is probably related to a Google update on the google place services. You can find which library is using AndroidX with this command:
gradlew app:dependencies
App is the name of your module/project but that is usually the default one.
If you can't solve this this way, post your project and app build.gradle
Make sure that you import the right version for AndroidX from here: https://developer.android.com/jetpack/androidx/migrate
I got stuck one day also just because integrate wrong version. So check it just to be sure.
I am using leakcanary 1.6.3 in my project to find memory-leaks without any problem using:
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
Now I want to update it to leakcanary 2.0 alpha 2 using:
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-2
But when I try to build project, it gives me manifest merger failed.
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:10:5-50:19 to override.
How do I fix this error?
Update: I am using android.support libraries in my project.
After some research in leakcanary 2.0 alpha 2 code, I found that the new version of library uses androidx libraries but I am using android.support libraries in my project. If I refactor my project to use androidx then no error occur.
It seems that:
A project using androidx can use a library that uses android.support
But a project using android.support can not use a library that uses androidx
This SO answer explain androidx and how to migrate your project to androidx.