Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache cordova Build failed on implementing firebase : Dependency failing

this is the Error

[ What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.0. 1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.firebase:firebase-messaging:19.0.1 -> com.google.firebase:firebase-iid@[19.0.1], but fire base-iid version was 20.0.2.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue.]Here is the command prompt picture---view

like image 528
Sachin Priyaprathapan Avatar asked Mar 03 '23 22:03

Sachin Priyaprathapan


1 Answers

Happened to me today as well. In my case, I solved it by changing in the package.json file the firebase messaging version to 20.1.+, although I had an earlier version than 19.0.1, so maybe it won't work for your project.

Update:

If you are using a cordova plugin, then it depends on how you can specify to that plugin which version of the Google's messaging library you want to use.

For example in my case, I'm using the cordova-plugin-firebase-messaging that has the following statement in the readme:

Use variables FIREBASE_ANALYTICS_VERSION, FIREBASE_MESSAGING_VERSION and ANDROIDX_CORE_VERSION to override dependency versions on Android.

So, in my package.json, i'd include the following:

{
    ...
    "dependencies": {
        ...
        "cordova-plugin-firebase-messaging": "4.0.1"
    },
    "cordova" : {
        ...
        "plugins": {
            "cordova-plugin-firebase-messaging": {
                "FIREBASE_MESSAGING_VERSION": "20.1.+"
            }
        }
    }
}

But this is only for this cordova plugin, if you are using another, take a look in their readme to check if you can specify the version for the native messaging library.

like image 93
Sogeking Avatar answered May 09 '23 08:05

Sogeking