Manifest merger failed : Attribute application@appComponentFactory updating Firebase libraries

前端 未结 6 999
孤街浪徒
孤街浪徒 2020-11-30 10:56

I am trying to add firebase in my project but when I implement \'com.google.firebase:firebase-messaging:19.0.0\' and \'com.google.firebase:firebase-core:1

相关标签:
6条回答
  • 2020-11-30 10:56

    28.0.0 was the last version of the original support libraries and these are no longer maintained. All functionality which was present in the support libraries is now a part of the AndroidX namespace and Google recommends that you move to AndroidX.

    In Android Studio 3.2 and higher you can migrate by doing a Refactor->Migrate to AndroidX

    However note that there may be some changes that you may have to do manually if you've specialized your configuration.

    Here's a video on the topic and the official documentation

    0 讨论(0)
  • 2020-11-30 11:01

    Try this and sync your project, if this can help you

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    
    0 讨论(0)
  • 2020-11-30 11:08

    With new release, libraries are migrated from the Android Support Libraries to the Jetpack (AndroidX) Libraries.

    The updated libraries will not work unless you make the following changes in your app:

    • Upgrade com.android.tools.build:gradle to v3.2.1 or later.

    • Upgrade compileSdkVersion to 28 or later.

    • Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.

    Method-1 :

    add this two in your gradle.properties File, without updating anything

    android.useAndroidX=true
    android.enableJetifier=true
    

    Method-2

    if Method-1 doesn't solve your problem do one thing if you are using android studio version 3.2 or higher go to Refactor>Migrate to AndroidX...

    0 讨论(0)
  • 2020-11-30 11:09

    According to the firebase site to solve this issue:

    • Update your app to use Jetpack (AndroidX), you can do this by adding these two lines: android.useAndroidX=true and android.enableJetifier=true into file gradle.properties in the project root directory. Or you can do another method
    • Upgrade com.android.tools.build:gradle to v3.2.1 or later (in project build.gradle file)
    • Upgrade compileSdkVersion to 28 or later (in project build.gradle file)
    0 讨论(0)
  • 2020-11-30 11:11

    You are using both support libraries and androidx libraries and you can't do it.

    Cloud Messaging version 19.0.0 is in the June release. Check the official release notes of Firebase Libraries:

    This release is a MAJOR version update and includes breaking changes. With this release, libraries are migrated from the Android Support Libraries to the Jetpack (AndroidX) Libraries. The updated libraries will not work unless you make the following changes in your app:

    • Upgrade com.android.tools.build:gradle to v3.2.1 or later.
    • Upgrade compileSdkVersion to 28 or later.
    • Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
    0 讨论(0)
  • 2020-11-30 11:12

    Either downgrade those Firebase dependencies - or migrate to androidx.

    The Jetifier is rather useless, because having control over the own dependencies.

    0 讨论(0)
提交回复
热议问题