Ad

My App Broke After Firebase Updated A Breaking Change

"dependencies": {
    "cordova-android": "^7.1.4",
    "cordova-plugin-badge": "^0.8.8",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-firebase-messaging": "1.3.1",
    "cordova-plugin-ionic-keyboard": "2.1.3",
    "cordova-plugin-ionic-webview": "4.0.0",
    "cordova-plugin-local-notification": "^0.9.0-beta.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-support-android-plugin": "1.0.1",
    "cordova-support-google-services": "1.3.1"
},
"cordova": {
    "plugins": {
        "cordova-plugin-whitelist": {},
        "cordova-plugin-ionic-keyboard": {},
        "cordova-plugin-ionic-webview": {
            "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
        },
        "cordova-support-google-services": {},
        "cordova-plugin-firebase-messaging": {
            "FIREBASE_CORE_VERSION": "16.0.+",
            "FIREBASE_MESSAGING_VERSION": "17.4.+",
            "ANDROID_SUPPORT_VERSION": "27.+"
        },
        "cordova-plugin-local-notification": {},
        "cordova-plugin-camera": {},
        "cordova-plugin-file": {}
    },
    "platforms": [
        "android"
    ]
}

My app was building well, after firebase updated Update - May 07, 2019 https://firebase.google.com/support/release-notes/android

my app cannot build anymore. it returns the following log:

Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.google.firebase, artifactId=firebase-messaging, version=17.4.0), toArtifact=Artifact(groupId=com.google.firebase, artifactId=firebase-iid), toArtifactVersionString=[17.1.0]) :app:preReleaseBuild FAILED

FAILURE: Build failed with an exception.

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

Dependency failing: com.google.firebase:firebase-messaging:17.4.0 -> com.google.firebase:[email protected][17.1.0], but fire base-iid version was 17.1.2.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends onto com.google.firebase:[email protected]+ -- Project 'app' depends onto com.google.firebase:[email protected]+

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s 14 actionable tasks: 1 executed, 13 up-to-date /home/user/herot/herot-eyes/src-cordova/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

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

Dependency failing: com.google.firebase:firebase-messaging:17.4.0 -> com.google.firebase:[email protected][17.1.0], but fire base-iid version was 17.1.2.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends onto com.google.firebase:[email protected]+ -- Project 'app' depends onto com.google.firebase:[email protected]+

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

app:spawn Command "cordova" failed with exit code: 1 +1ms app:cordova-conf ⚠️ [FAIL] Cordova CLI has failed +0ms app:cordova Shutting down Cordova process... +1ms

How can i solve this issue???

Ad

Answer

Someone found a workaround at the moment. Just do this and it should fix your problem:

ionic cordova plugin rm cordova-plugin-firebase-messaging
ionic cordova plugin add cordova-plugin-firebase-messaging --variable ANDROID_SUPPORT_VERSION=26.1

https://github.com/chemerisuk/cordova-plugin-firebase-messaging/issues/82

Ad
source: stackoverflow.com
Ad