Error: Fix the Version Conflict (Google-Services Plugin)

Error: fix the version conflict (google-services plugin)

I think you change

compile 'com.google.firebase:firebase-messaging:11.0.4'

Error Please fix the version conflict either by updating the version of the google-services

Change this:

classpath 'com.google.gms:google-services:3.1.1'

into this:

classpath 'com.google.gms:google-services:4.0.1'

to avoid the mixing version error.

Also update the firebase-core dependency into this:

implementation 'com.google.firebase:firebase-core:16.0.1'

https://firebase.google.com/support/release-notes/android

Error: fix the version conflict (google-services plugin) using productFlavors

The conflict is between a newer version of the plugin and the Play Services/Firebase dependencies.

You cannot apply different versions of the same plugin for different product flavors, thus you will run into this conflict when trying to use different Play Services dependencies in different flavors.

You can:

  • Drop support for the ~1% of users on API levels lower than 14 in new versions of your app
  • Stay on an older Play Services/Firebase version that still supports 14

Version conflict (google-services plugin)

Update the google-service plugin to 'com.google.gms:google-services:3.3.0'

However, its always better to have same version among the same library file to prevent any project sync crash.

Example,

implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-ads:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.2'
implementation 'com.google.android.gms:play-services-plus:15.0.2'

Error: fix the version conflict (google-services plugin 11.6.0)

You should use the same version for the google play service libraries and firebase libraries.

Change:

implementation 'com.google.firebase:firebase-messaging:10.2.6'

with

implementation 'com.google.firebase:firebase-messaging:11.6.0'

Error : Please fix the version conflict either by updating the version of the google-services plugin

Use the same version of firebase and Google play services

compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'

//Remove this dependency
//compile 'com.google.gms:google-services:3.1.1'

//Add this dependency if you need Google play services
compile 'com.google.android.gms:play-services:11.4.2'

Android google services plugin version conflict

Move this line at last
apply plugin: 'com.google.gms.google-services'

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.globemaster.samples"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//
//
}
apply plugin: 'com.google.gms.google-services'

At the bottom of the (app)build.gradle script and rebuild the project.

Note:- I think that it has to do something with referencing
dependencies that have not yet been created. Something like calling a
variable before you even declare it

Error: fix the version conflict (google play services) Kotlin

You have to use implementation instead of compile.

And use this gradle libraries, I already checked in my pc.

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.41"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services:12.0.1'

Also In Project level build.gradle add repositories:

repositories {
maven{
url "https://maven.google.com"
}
google()
jcenter()
}

Check screenshot for better understand:

Sample Image



Related Topics



Leave a reply



Submit