1

Error given:

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).

Gradle dependencies

dependencies {
implementation project(':react-native-image-resizer')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-device-info')
implementation project(':react-native-camera')
implementation project(':react-native-agora')
implementation fileTree(dir: "libs", include: ["*.jar"])

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation "com.facebook.react:react-native:+"  // From node_modules
implementation 'com.getkeepsafe.relinker:relinker:1.3.0'
implementation 'com.android.volley:volley:1.1.0'
implementation files('src/main/jniLibs/HCNetSDK.jar')
implementation files('src/main/jniLibs/PlayerSDK.jar')
implementation 'com.ncorti:slidetoact:0.5.1'
implementation 'com.squareup.picasso:picasso:2.71828'

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.pusher:push-notifications-android:1.0.2'
}

Edit: This GitHub ticket helped me solve it, seemed to be an androidx and react-native problem. Got gms and firebase versions here

NewProgrammer
  • 164
  • 3
  • 16

1 Answers1

1

You need to migrate to AndroidX from andorid.support and android.arch dependencies. Your project is having conflicts as the error message says probably because of react native depencencies,

This link should be helpful

Take a look also here

TL;DR Get rid of all andorid.support and android.arch dependencies and use androidX instead

for example change

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

into

implementation 'androidx.constraintlayout:constraintlayout:1.1.2',

second example change

implementation 'com.android.support:animated-vector-drawable:28.0.0'

into

implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'

and do similar for all support dependencies

Karol Żygłowicz
  • 2,442
  • 2
  • 26
  • 35
  • I just did this and it gives me errors like this error: package android.support.v4.content does not exist import android.support.v4.content.ContextCompat. This is coming from node modules. Is there anyway to make it so it reconizges the android packages even though im now using the androidx decencies? – NewProgrammer Jun 18 '19 at 21:18
  • yea this is part of migration. Your new import line should look like this: `import androidx.core.content.ContextCompat` since you don't use support.v4 any more. You need to change all other imports that are referencing support. In my answear's first link https://developer.android.com/jetpack/androidx/migrate I gave you the guide how to change the mapping. There is a list of Old build artifacts and AndroidX correspondent ones – Karol Żygłowicz Jun 20 '19 at 10:52