Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

Task :app:buildInfoGeneratorDebug

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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 35s 14 actionable tasks: 4 executed, 10 up-to-date

like image 830
alexa 100000 Avatar asked Apr 20 '19 06:04

alexa 100000


1 Answers

Try Adding 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.

Hope it works for you !

like image 181
abhinandan sharma Avatar answered Nov 23 '22 09:11

abhinandan sharma