Admob Free plugin and Firebase Analytics google service dependency cinflict

BUILD FAILED in 3s
3 actionable tasks: 3 executed
/Users/bhansali/code/TagHero/taghero/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    Failed to capture fingerprint of input files for task ‘:app:preDebugBuild’ property ‘compileManifests’ during up-to-date check.

In project ‘app’ a resolved Google Play services library dependency depends on another at an exact version (e.g. “[11.0.
4]”, but isn’t being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-ads:11.0.4 -> com.google.android.gms:play-services-basement@[11
.0.4], but play-services-basement version was 17.0.0.

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.android.gms:play-services-gass@11.0.4
– Project ‘app’ depends onto com.google.android.gms:play-services-clearcut@11.0.4
– Project ‘app’ depends onto com.google.android.gms:play-services-tasks@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-impl@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-base@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-safetynet@11.0.4
– Project ‘app’ depends onto com.google.firebase:firebase-iid-interop@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-sdk-api@17.0.0
– Project ‘app’ depends onto com.google.firebase:firebase-analytics@17.0.0
– Project ‘app’ depends onto com.google.firebase:firebase-core@17.0.+
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-base@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-api@17.0.0
– Project ‘app’ depends onto com.google.firebase:firebase-measurement-connector@18.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-ads-identifier@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-base@11.0.4
– Project ‘app’ depends onto com.google.android.gms:play-services-ads@11.0.4
– Project ‘app’ depends onto com.google.firebase:firebase-core@17.0.1
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement-sdk@17.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-ads-lite@11.0.4
– Project ‘app’ depends onto com.google.android.gms:play-services-stats@17.0.0
– Project ‘app’ depends onto com.google.firebase:firebase-common@18.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-basement@17.0.0
– Project ‘app’ depends onto com.google.firebase:firebase-iid@19.0.0
– Project ‘app’ depends onto com.google.android.gms:play-services-measurement@17.0.0

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.

Problem: Admob Free plugin comes with default 11.0.4 version of google-services
Even after multiple attempts not able to fix it. Please help.

For me it worked by changing “PLAY_SERVICES_VERSION” to “17.0.0” inside “\plugins\cordova-admob-sdk\plugin.xml”.

I was facing the same issue while tring to make firebase-analytics work with cordova-admob-free and tried many things.

  1. As mentioned by @AlexBa “PLAY_SERVICES_VERSION” to “17.0.0” inside “\plugins\cordova-admob-sdk\plugin.xml” fixed my build isuue but then firebase was not picking up events and screenview.

What Finally solved my issue was following the above plus adding the below in config.xml

Exact Steps Followed:

  1. Remove platform android

  2. remove admob-free plugin and firebase-analytics plugin

  3. insttall firebase-analytics plugin and add it to top-level

  4. add platform android

  5. add admob-free plugin and change “PLAY_SERVICES_VERSION” to “17.0.0” inside “\plugins\cordova-admob-sdk\plugin.xml” and “PLAY_SERVICES_VERSION” to “17.0.0” \plugin\android.json for both cordova-admob-sdk and cordova-admobd-free

  6. addd the below line in config.xml


  7. Build

For some reason i was not able to do this by adding abmob-plugin before adding android platform. I hope this helps.