简体   繁体   中英

Adding FbFlipper in Android Project gives build error = processDebugManifest > Manifest merger failed

I have added FbFlipper Metrics. I am getting this error.

Task :app:processDebugManifest FAILED /home/user/Git/my-project/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:21:583-76:18 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:21:583-76:18 to override.

For More Information:

I have added FbFlipper Metrics library as: In build.gradle under dependencies:

debugImplementation 'com.facebook.flipper:flipper:0.22.0'
debugImplementation 'com.facebook.soloader:soloader:0.6.0'

And if i comment/remove the above mentioned lines from build.gradle. Project build successfully and runs fine on device.

But if i add these lines to add FbFlipper. It gives build error.

Keeping in View i have no duplicate activity names in Android Manifest. Also i have updated compileSdkVersion from 27 to 28 which resolves my earlier issue which was:

Execution failed for task ':app:processDebugResources'. Android resource linking failed

Now i'll appreciate any help in this regard, Point me where i am wrong. how to make FbFlipper metrics working in android project. Thanks in advance

My Environment details:

  • Gradle Version: 5.0
  • compileSdkVersion 28
  • Android Plugin Version: 3.3.0
  • FbFlipper Metrics Library Version: 0.22.0

I resolve this error by Migrating all support libraries to AndroidX .

You can do it as:

In gradle.build (app) add sdkVersion as 28:

compileSdkVersion 28
defaultConfig {
    ......
    targetSdkVersion 28
    ......
}

Also add these implementations to migrate to androidx :-

implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

Then add these below two lines to gradle.properties:-

android.useAndroidX=true
android.enableJetifier=true

You can also do that from android studio in automated format.

  • From the top bar menu in Android Studio
  • Click on Refactor
  • Then from Dropdown list. Click on 'Migrate to AndroidX'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM