this is my Project Gradle dependencies
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.0.0'
classpath "io.realm:realm-gradle-plugin:4.2.0"
classpath 'com.google.firebase:firebase-plugins:1.1.1'
this is my App Gradle dependencies
implementation 'com.google.android.gms:play-services-ads:11.4.2'
implementation 'com.google.firebase:firebase-core:11.4.2'
implementation 'com.google.android.gms:play-services-base:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
Also i have change implementation to api ... the error still appears
add below dependency into app level gradle file ..
Where do you apply the google-services plugin? https://developers.google.com/android/guides/google-services-plugin#introduction requires you apply it at the bottom of your app's build.gradle to avoid dependency collisions similar to the one you are describing.
You can also run
./gradlew :app:dependencies
to see if you have any dependency collisions which lead to multiple versions of firebase-core.You just need to change your google lib version into the stable version. you are using an unstable version. Use following
and use this classpath
and remove the firebase classpath from the project