Search code examples
androidfirebaseionic-frameworkandroid-build

Ionic Android Build - com.google.android.gms:play-services-measurement-base Error


My error:

:app:preReleaseBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
The library com.google.android.gms:play-services-measurement-base is being
requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], 
but resolves to 16.5.0. Disable the plugin and check your dependencies tree
using ./gradlew :app:dependencies.

I reinstalled the npm and cordova plugins for Firebase, I deleted the node-modules, the plugins and everything but the issue is still there and can't build the project.

Any thoughts?


Solution

  • This resolved my problem:

    1. In your project folder execute cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
    2. ionic cordova platform rm android
    3. ionic cordova platform add android.

    You can find the solution here: https://github.com/arnesson/cordova-plugin-firebase/pull/1058