Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest merger failed : Android #25307

Closed
nahidmbstu opened this issue Jun 19, 2019 · 31 comments
Closed

Manifest merger failed : Android #25307

nahidmbstu opened this issue Jun 19, 2019 · 31 comments
Labels
Bug Platform: Android Android applications. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@nahidmbstu
Copy link

Environment:
OS: Linux 4.15
Node: 8.15.0
Yarn: 1.12.3
npm: 6.4.1
Watchman: 4.7.0
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Steps to reproduce:

  1. react-native run-android
    2 gives me this error .
  • 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).

@nahidmbstu nahidmbstu added the Bug label Jun 19, 2019
@react-native-bot react-native-bot added Platform: Android Android applications. Platform: Linux Building on Linux. labels Jun 19, 2019
@udaisubramaniam
Copy link

Refer to my comment here for the fix: #25296 (comment)

@blohamen
Copy link

+1 Same behavior

@nahidmbstu
Copy link
Author

@udaisubramaniam did not work!

@blohamen
Copy link

Refer to my comment here for the fix: #25296 (comment)

Fixed for me

@rocky225
Copy link

because RN 0.60.0 suport androidx
and your module use RN 0.60.0
you can replace you build.gradle code '+' to '0.59.8' and
googlePlayServicesVersion = "15.0.1"
firebaseVersion = "17.6.0"
"react-native-camera": "^1.13.1"
See #25173 #25296

@nahidmbstu
Copy link
Author

not clear what to do. @rocky225

@fellmann
Copy link

Add to your package level android/build.gradle in buildscript -> ext:

    googlePlayServicesVersion = "16.+"
    firebaseVersion = "17.6.0"

See:
#25173 (comment)
#25296 (comment)

@nahidmbstu
Copy link
Author

@fellmann Tried that too . still the same error.

@yunhanxia
Copy link

Same issue

@DillionApple
Copy link

Same issue. All solutions listed above do not work for me.

@kstar11
Copy link

kstar11 commented Jun 19, 2019

@fellmann thanks a lot!
this error troubled me...and add these code to android/build.gradle,block 'buildscript'
ext { googlePlayServicesVersion = "16.+" firebaseVersion = "17.6.0" }
it's works!

@poojasharma3106
Copy link

Same issue. All solutions listed above do not work for me.

@sebacaccaro
Copy link

Add to your package level android/build.gradle in buildscript -> ext:

    googlePlayServicesVersion = "16.+"
    firebaseVersion = "17.6.0"

thanks @fellmann
adding just googlePlayServicesVersion = "16.+" worked fine for me

@songoten28
Copy link

songoten28 commented Jun 19, 2019

@nahidmbstu
Because not only 1 lib you are using relating to Google service.
you should try this " #25301 (comment) "
after you try above
If you found something cool like react-native-push-notification, react-native-device-info or something like that
add for that look like below

implementation(project(":react-native-device-info"),  {
      exclude group: "com.google.android.gms"
    })

implementation (project(':react-native-push-notification'), {
        exclude group: "com.google.android.gms"
        exclude group: "com.google.firebase"
    })

don't forget

ext { googlePlayServicesVersion = "16.+" firebaseVersion = "17.6.0" }

This problem come from Google and burning out for 1 days

@LMarcinkowski
Copy link

@fellmann Solution works. Thanks! I just waste few hours of researching this bug :/

@flafuente
Copy link

@songoten28 thanks mate, you are a star.

@rakibhasan48
Copy link

I will suggest to strict type the following packages as recent google services updated caused a lot of conflicts in dependencies:

 implementation(project(':react-native-maps')) {
     exclude group: 'com.google.android.gms', module: 'play-services-base'
     exclude group: 'com.google.android.gms', module: 'play-services-maps'
 }
 implementation(project(":react-native-device-info"),  {
     exclude group: "com.google.android.gms"
 })
 implementation 'com.google.firebase:firebase-core:16.0.1'
 implementation 'com.google.firebase:firebase-messaging:17.0.0'
 implementation 'com.google.android.gms:play-services-base:16.0.0'
 implementation 'com.google.android.gms:play-services-maps:16.0.0'
 implementation 'com.google.android.gms:play-services-gcm:16.0.0'

Check if you are using any of these libraries and specify the versions instead of using '+'

@ghost
Copy link

ghost commented Jun 19, 2019

The same issue, feeling that React native is broken. It all depends on how many packages you added to your project. The community does not maintain some packages. So it will break.

@felipepalazzo
Copy link

Refer to my comment here for the fix: #25296 (comment)

Fixed for me as well

@jackdvs
Copy link

jackdvs commented Jun 20, 2019

For me, it was react-native-admob, had to change its google play ad service dependency version to

implementation 'com.google.android.gms:play-services-ads:16+'

@rocky225
Copy link

@nahidmbstu

The same issue, feeling that React native is broken. It all depends on how many packages you added to your project. The community does not maintain some packages. So it will break.

your project's build.gradle
the modules has build.gradle file too
all build.gradle must replace

@ppv94
Copy link

ppv94 commented Jun 20, 2019

i am getting same error
AAPT: No resource identifier found for attribute 'appCompon
entFactory' in package 'android'

i changed googlePlayServicesVersion = '+' to googlePlayServicesVersion = '16.+'

what should i do
this is my build.gradle
ext {
googlePlayServicesVersion = '16.+'
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.0"
}

and my dependencies :

dependencies {
compile project(':react-native-image-crop-picker')
//compile project(':react-native-facebook-account-kit')
compile project(':react-native-youtube')
compile project(':react-native-vector-icons')
compile project(':react-native-compress-image')
compile project(':lottie-react-native')
compile project(':react-native-gesture-handler')
compile project(':react-native-image-picker')
compile project(':react-native-fbads')
compile project(':react-native-admob')
compile project(':react-native-share')
compile project(':react-native-android-permissions')
compile project(':react-native-view-shot')
compile project(':react-native-image-resizer')
compile project(':react-native-fs')
compile 'com.facebook.fresco:fresco:1.8.1'
compile 'com.facebook.fresco:animated-gif:1.8.1'
// For WebP support, including animated WebP
compile 'com.facebook.fresco:animated-webp:1.3.0'
compile 'com.facebook.fresco:webpsupport:1.3.0'
// For WebP support, without animations
compile 'com.facebook.fresco:webpsupport:1.3.0'
compile project(':react-native-fetch-blob')
compile project(':react-native-svg')
compile project(':react-native-fbsdk')
compile project(':react-native-linear-gradient')
compile fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation ("com.android.support:support-v4:${rootProject.ext.supportLibVersion}")
implementation ("com.android.support:design:${rootProject.ext.supportLibVersion}")
compile 'com.google.android.gms:play-services-ads:16.0.0'
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.google.android.gms:play-services-auth:+' // should be at least 9.0.0
implementation (project(':react-native-facebook-account-kit')) {
exclude group: "com.android.support"
}
}

@ppv94

@vishalenrique
Copy link

@nahidmbstu take a look at react-native-device-info/react-native-device-info#693 (comment). Using that, try to find which libraries from androidX is your project using and then add those libraries to the code below
configurations.all { resolutionStrategy.force ' ' } in android/build.gradle

@doancongbang1991
Copy link

modify your graddle.properties
android.enableJetifier=true
android.useAndroidX=true
use jetifier
npm install --save-dev jetifier (or use yarn, but install it locally in your project, not globally)
npx jetify or npx jetify -w=1 (to specify the number of parallel workers)
npx react-native run-android

@codedadysolutions
Copy link

There is a simple solution to fix this error (its worked for me)

Step 1:
Download Android Studio (Latest version, 3.4.1 or greater) & Open your android project in Android Studio.

Step 2:
Right Click on the app folder > Refactor > Migrate to AndroidX & click on migrate.
Screenshot 2019-06-23 at 6 40 40 PM

Step 3:
After migration, a Dialogue box appears, proceed with Do Refactor

It will give android X support for your project.

@Spaiz-01
Copy link

#25296 (comment)

it works for me!

@nysamnang
Copy link

nysamnang commented Jun 26, 2019

I had the same issue and took me headache one day and a half.
Finally, I fixed this problem by just changing the version of Google Play Service.
See Release Notes of Google play service.

In android/app/build.gradle:

Screen Shot 2562-06-26 at 9 50 29 AM

In my case i'm using play-services-base and play-services-maps.

Change all com.google.android.gms:play-services-* dependencies to version 16.+

    implementation 'com.google.android.gms:play-services-base:16.+'
    implementation 'com.google.android.gms:play-services-maps:16.+'

In android/build.gradle:

Screen Shot 2562-06-26 at 10 13 40 AM

Add ext { googlePlayServicesVersion = "16.+" } to buildscript.

Re-Build project then everything works fine!!!

@jawsvk
Copy link

jawsvk commented Jun 26, 2019

Ran into the same problem and fixed it by doing the following:

  1. Go into gradle.properties file and add this to the code:
android.useAndroidX=true
android.enableJetifier=true
  1. Run npm install --save-dev jetifier
  2. Run npx jetify
  3. Run npx react-native run-android to start your app

@canpoyrazoglu
Copy link

Adding
googlePlayServicesVersion = "16.+" and firebaseVersion = "17.6.0" to gradle's ext did NOT work for me.

I then tried @codedadysolutions's comment and migrated to AndroidX. It got rid of compile errors and got to compile, but in runtime I get:

2019-06-27 13:56:55.945 3166-3800/com.test E/SoLoader: Error when loading lib: dlopen failed: library "libjsc.so" not found lib hash: 9f147276937ca9f5dfbf5ff8b8b470c1 search path is /data/app/com.test-jaW81HQ65ONHL6Qdo2O7fA==/lib/x86
2019-06-27 13:56:55.945 3166-3800/com.test E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found
    
    --------- beginning of crash
2019-06-27 13:56:55.947 3166-3800/com.test E/AndroidRuntime: FATAL EXCEPTION: create_react_context
    Process: com.test, PID: 3166
    java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
        at com.facebook.react.jscexecutor.JSCExecutor.<clinit>(JSCExecutor.java:19)
        at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:29)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:949)
        at java.lang.Thread.run(Thread.java:764)

This is a fresh new project with RN 0.60 RC2

@songoten28
Copy link

songoten28 commented Jun 29, 2019

@canpoyrazoglu add your config like this
app build.gradle

defaultConfig {
        ndk {
          abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
dependencies {
    implementation "org.webkit:android-jsc-intl:+"
}

@kelset
Copy link
Contributor

kelset commented Jul 1, 2019

This is a duplicate of #25293, please read the issue there to understand your problem. It's not strictly caused by the main react-native library itself.

@kelset kelset closed this as completed Jul 1, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Jul 1, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests