- tools:replace=»android:appComponentFactory» android:appComponentFactory=»android.support.v4.app.CoreComponentFactory» #18
- Comments
- shenbuqingyun commented Jan 4, 2019
- shenbuqingyun commented Jan 4, 2019
- shenbuqingyun commented Jan 4, 2019
- jaredrummler commented Jan 16, 2019
- LuiguiBalarezo commented Jan 27, 2019
- Ahyer commented Mar 30, 2019
- Android X: tools:replace specified at line: for attribute, but no new value specified
- 11 Answers 11
- Manifest Merger fails for appComponentFactory [duplicate]
- 8 Answers 8
- Manifest merger failed : Attribute application@appComponentFactory — Androidx
- 12 Answers 12
- Put these flags in your gradle.properties
- Reason of this error-
- What is solution?
- How to migrate your project
- Existing project
- New project
- Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] [duplicate]
tools:replace=»android:appComponentFactory» android:appComponentFactory=»android.support.v4.app.CoreComponentFactory» #18
Comments
shenbuqingyun commented Jan 4, 2019
Program type already present: android.support.v4.graphics.drawable.IconCompatParcelizer
The text was updated successfully, but these errors were encountered:
shenbuqingyun commented Jan 4, 2019
Manifest merger failed : Attribute application@appComponentFactory
shenbuqingyun commented Jan 4, 2019
Suggestion: add ‘tools:replace=»android:appComponentFactory»‘ to element
jaredrummler commented Jan 16, 2019
Are you sure this is related to the library? It isn’t using IconCompatParcelizer
LuiguiBalarezo commented Jan 27, 2019
Hola a todos
Tengo el mismo Problema
—- 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:5:5-23:19 to override. —-
Gracias por la atención
Ahyer commented Mar 30, 2019
Hola a todos
Tengo el mismo Problema
—- 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:5:5-23:19 to override. —-
Gracias por la atención
I also meet this question.I have solved it. My compileSdkVersion is 28.
You only chose Refactor-Migrate to AndroidX.
Done.
Источник
Android X: tools:replace specified at line: for attribute, but no new value specified
I have tried many solutions on this website but still, the problem is not solved. The issue is due to Android X library. When I added Android X, this issue was resolved but it opened up new issue. How to fix this issue?
Earlier this error was coming:
After I added tools:replace=»android:appComponentFactory» , this error is came:
Merging Error (in Android Manifest):
Error: tools:replace specified at line:2 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 1
11 Answers 11
I think you are migrating to AndroidX libs.
Add below lines to gradle.properties file
Remove tools:replace=»android:appComponentFactory» from manifest.
Replace android.support.v7.app.AppCompatActivity to androidx.appcompat.app.AppCompatActivity
You can try adding:
I got same error in my project, I have resolved it You can try it
Android Studio > Refactor > Migrate to AndroidX
In my case, I had updated Firebase and play services dependency, result in this issue.
Reverted back the dependency updates and the error vanished
Seems that the latest Firebase and Play Service dependencies are compatible with androidx.
It often happened because you used Androidx libraries and support libraries at the same time. Some 3rd-party libraries may contain support libraries and other 3rd-party libraries may contain Androidx libraries, this can also lead this problem. If you have gradle environment in you PC, try «gradlew :app:dependencies» command in the terminal of Android Studio, this command will list all libraries including 3rd-party libraries of your project, and see which library or framework used Androidx libraries and which not. Then try to upgrade old libraries used support libraries, and this problem should disappear.
Источник
Manifest Merger fails for appComponentFactory [duplicate]
Using Google’s so called Material Design 2.0 requires you to add
in the app Gradle which also includes
which shows conflicts
Here’s what the log says
Even after adding that to the Manifest it shows Manifest Merger failed with multiple error
8 Answers 8
This error is common nowadays:
When we get this types of error: When library is updated and providing use of AndroidX but we are using old one.
You can follow the steps to solve this:
- Migrate your project to AndroidX:
With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.
Note: To migrate an existing project that does not use any third-party libraries with dependencies that need converting, you can set the android.useAndroidX flag to true and the android.enableJetifier flag to false.
THIS STEP WILL DO EVERYTHING AUTOMATICALLY THAT ALL ANSWER SAYS TO DO MANUALLY
- You can check Overview of AndroidXhere.
- More details for migration
Even If you get any other error like run-time build failed, then:
- Invalidate cache and restart
Источник
Manifest merger failed : Attribute application@appComponentFactory — Androidx
When I’m building Gradle with androidx I get the following error. Please help me to solve this issue.
Error Message: 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).
12 Answers 12
Put these flags in your gradle.properties
After hours of struggling, I solved it by including the following within app/build.gradle:
Put these flags in your gradle.properties
Changes in build.gradle:
Reason of this error-
Because after upgrade, androidx.core:core is accessed somewhere, when your project is still not using androidx. So classes like CoreComponentFactory and many others are now found at two places — androidx.core:core and com.android.support:support-compat . That’s why this error occured.
What is solution?
You should migrate to AndroidX. If you don’t know about AndroidX. Please read What is AndroidX?
How to migrate your project
After Android Studio 3.2 (September 2018), there is direct option to migrate existing project to AndroidX . This refract all packages automatically.
Before you migrate, it is strongly recommended to backup your project.
Existing project
- Android Studio > Refactor Menu > Migrate to AndroidX.
- It will analysis and will open Refractor window in bottom. Accept changes to be done.
New project
Put these flags in your gradle.properties
Error explicitly says-
[com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0]
AndroidX is the latest support library from Google. It contains all previous components from all older appcompat versions. Do NOT use appcompat-v-any number. Instead, use a similar component from AndroidX libraries. Remove the numbered support libraries from your Gradle and your code wherever it is imported. Then sync your gradle.
Component similarity table can be found here. Also, follow the steps mentioned in Migrating to AndroidX.
Again, stop using any previous appcompat numbered versions. There’s only AndroidX now.
Источник
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] [duplicate]
Hi I was working on a Project where I used many dependencies of Libraries. It was working fine but suddenly it has started to report errors. I am new in using Libraries dependencies and I am using Firebase database and storage and also have added google-services.json under app folder. I couldn’t understand where the problem lies. Thanks for help in advance
Following is the Error list
`Executing tasks: [:app:assembleDebug]
Configure project :app Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Task :app:buildInfoDebugLoader Task :app:preBuild UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :app:compileDebugAidl NO-SOURCE Task :app:compileDebugRenderscript UP-TO-DATE Task :app:checkDebugManifest UP-TO-DATE Task :app:generateDebugBuildConfig UP-TO-DATE Task :app:prepareLintJar UP-TO-DATE Task :app:generateDebugSources Task :app:javaPreCompileDebug UP-TO-DATE Task :app:mainApkListPersistenceDebug UP-TO-DATE Task :app:generateDebugResValues UP-TO-DATE Task :app:generateDebugResources UP-TO-DATE
Task :app:processDebugGoogleServices Parsing json file: C:\Users\alexa\AndroidStudioProjects\eCommerceProject\app\google-services.json
Task :app:mergeDebugResources UP-TO-DATE Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:processDebugManifest FAILED C:\Users\alexa\AndroidStudioProjects\eCommerceProject\app\src\main\AndroidManifest.xml:22:18-91 Error: 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:8:5-36:19 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ‘:app:processDebugManifest’.
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:8:5-36:19 to override.
Try: Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.
BUILD FAILED in 35s 14 actionable tasks: 4 executed, 10 up-to-date
Источник