3

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

build error android every time I build this I got same problem for project enter image description here

Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
  • Possible duplicate of [com.google.android.gms:play-services-measurement-base is being requested by various other libraries](https://stackoverflow.com/questions/50577437/com-google-android-gmsplay-services-measurement-base-is-being-requested-by-vari) – abitcode Oct 12 '18 at 17:48

2 Answers2

4

For those who still have this problem on the Ionic framework. After 2 day's of trying, I succeeded to build my project.

  1. npm i cordova-android-firebase-gradle-release
  2. npm i cordova-android-support-gradle-release
  3. In package.json under plugins, you should have this:
      "cordova-android-play-services-gradle-release": {
        "PLAY_SERVICES_VERSION": "+"
      },
      "cordova-android-firebase-gradle-release": {
        "FIREBASE_VERSION": "+"
      }

  1. In config.xml, you should have these:
    <plugin name="cordova-android-play-services-gradle-release" spec="^2.0.0">
        <variable name="PLAY_SERVICES_VERSION" value="+" />
    </plugin>
    <plugin name="cordova-android-firebase-gradle-release" spec="^2.0.0">
        <variable name="FIREBASE_VERSION" value="+" />
    </plugin>

That's it. Hope it helps :)

Milos Segic
  • 111
  • 1
  • 2
  • 8
  • sir i have tried but i got 6: error: cannot find symbol import com.google.firebase.iid.FirebaseInstanceIdService ? – Kapil Soni May 07 '19 at 07:30
-1

Remove com.google.android.gms:play-services:15.0.1 from Gradle and use only individual which you have required.

check here.

Note: Don't use the combined play-services target. It brings in dozens of libraries, bloating your application. Instead, specify only the specific Google Play services APIs your app uses.

Abhay Koradiya
  • 2,068
  • 2
  • 15
  • 40