React-native-firebase: Android dependency 'com.google.firebase:firebase-messaging' has different version for the compile (18.0.0) and runtime (19.0.0) classpath. You should manually set the same version via DependencyResolution

Created on 18 Jun 2019  路  6Comments  路  Source: invertase/react-native-firebase

Hey guys,

I am facing this above issue since yesterday.
Initially, Everything was working fine but suddenly the project stops working.

Dependencies are:

  • "react-native-firebase": "^4.3.8"

  • "react-native": "0.55.4",

Solutions tried:

Tired to change the version of com.google.firebase:firebase-messaging to 19.0.0 in Build.gradle file.But it gives another error

  • Also tried to follow this link [https://developers.google.com/android/guides/releases]

These are my other dependencies in build.gradle:

`
implementation "com.google.android.gms:play-services-base:16.1.0"

implementation "com.google.firebase:firebase-core:16.0.9"

implementation "com.google.firebase:firebase-auth:17.0.0"

implementation "com.google.firebase:firebase-messaging:18.0.0"

implementation "com.google.firebase:firebase-ads:15.0.1"

implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar')

`

Please help if anyone face that issue

Most helpful comment

Hey @mikehardy
I followed the release update of android(updating the compile SDK version and gradle).
but no luck that creates another issue.

Will you please describe steps to solve this problem and I stuck in this from 3 days

try add force = true in build.gradle:

compile ("com.google.firebase:firebase-messaging:19.0.0") {
    force = true
}

All 6 comments

Check the versions and the release notes, Google Play released a breaking change and you need to pin your dependencies using ext{} blocks to make sure you don't pull in the AndroidX version. This is essentially a duplicate then - #1588 - not to be short but the entire react-native ecosystem is dealing with this earthquake at the moment. Just know that projects will build you just need to specify your dependencies carefully (as was always the case but this hit more people at once)

Hey @mikehardy
I followed the release update of android(updating the compile SDK version and gradle).
but no luck that creates another issue.

Will you please describe steps to solve this problem and I stuck in this from 3 days

I have similar problem.

Hey @mikehardy
I followed the release update of android(updating the compile SDK version and gradle).
but no luck that creates another issue.

Will you please describe steps to solve this problem and I stuck in this from 3 days

try add force = true in build.gradle:

compile ("com.google.firebase:firebase-messaging:19.0.0") {
    force = true
}

Thanks @procoru
I tried but now it gives another error:

AAPT: No resource identifier found for attrib
ute 'appComponentFactory' in package 'android'

Also tried to solve this problem then it gives another error, didn't find the particular solution

Sorry guys, this is general gradle stuff, it's not specific to this library. You'll have to read up on how to manage your gradle dependencies, and since those specific versions (from 18 to 19 on messaging) cross the AndroidX boundaries you'll have to learn up on that as well. This will be happening for the next couple months, it's worth the study time https://developer.android.com/jetpack/androidx/migrate / https://github.com/facebook/react-native/issues/25293

Was this page helpful?
0 / 5 - 0 ratings

Related issues

csumrell picture csumrell  路  3Comments

Damnum picture Damnum  路  3Comments

romreed picture romreed  路  3Comments

escobar5 picture escobar5  路  3Comments

Draccan picture Draccan  路  3Comments