Error: Please fix the version conflict - android

While using the dependencies shows error on either auth or on database.how to resolve this???
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//here it shows error Error:Execution failed for task ':app:processDebugGoogleServices'
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.8.0.
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.basgeekball:awesome-validation:4.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-core:11.8.0'
}
apply plugin: 'com.google.gms.google-services'

Change the following:
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-auth:11.0.4'
to this:
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
all firebase dependencies need to be the same version

Obviously, you can use firebaseAuth and firebase Realtime database at the same time. But your gradle dependencies for firebase should be of same version.

Related

gradle sync failed with 1 warning Please fix the version conflict either by updating the version of the google-services plugin to 16.0.4

i tried all possible methods and it still did not sync please help. Below is my whole gradle file, i have tried to merge the firebase core and messaging but it still shows the error
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:1.1.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.squareup.okhttp:okhttp:2.5.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.github.arturogutierrez:badges:1.0.5#aar'
implementation 'com.github.broakenmedia:CharCountTextView:v1.0'
implementation 'com.github.broakenmedia:MultiContactPicker:1.8.3'
implementation 'com.github.lguipeng:BubbleView:1.0.1'
implementation 'com.rockerhieu.emojicon:library:1.3.3'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
Below is the error message
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.4.
In your project build.gradle file, replace with below line:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
compile 'com.google.gms:google-services:4.2.0'//the latest version is 4.2.0
}
}
You are using different versions of firebase dependencies. That may be the reason for the failure. Update the google-services to latest version and use same version for firebase dependencies..
// as you can see different versions for firebase dependecies
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-database:16.0.4'
Either use 16.0.4 or the latest version of firebase dependencies.

Please fix the version conflict either by updating the version of the google-services plugin (Firebase and Google Maps)

I know this question has been asked several times, but I can't seem to find to a work around it. I've updated all the implementations to the latest version but I still get the error below.
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.3.
I'm building an app that uses firebase and maps. The project builds okay at first (without connecting to firebase) but when I do connect and add the google-services plugin, I get the error above
apply plugin: 'com.google.gms.google-services'
This is my build.gradle (Module: app) file
....
dependencies
{
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Support
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
// Android TestImplementation
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'
// Firebase Authentication
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
// Google Play Services
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
// Google Sign In SDK
implementation 'com.google.android.gms:play-services-auth:16.0.0'
}
apply plugin: 'com.google.gms.google-services'
Can someone kindly explain to me where I'm going wrong

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

This is my build.gradle(app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.google.android.gms:play-services-auth:15.0.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
}
These are my dependencies in build.gradle(project):
{
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.2.1'
}
Can anyone please help with what I am doing wrong here?
Check google services version and it is not compatible with the gradle version.
{
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.2.1'
}
Try to downgrade or upgrade google services version.
Missing some of your gradle and log information I give it a try, but I might be wrong:
Build (Project level) (3.2.1 doesn't exists, it is 3.1.2)
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.1.2'
}
Build (app level)
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.firebaseui:firebase-ui-auth:2.3.0'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.firebaseui:firebase-ui:1.2.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'com.firebaseui:firebase-ui-storage:1.2.0'
(appcompat downgraded, firebase upgraded, compile replaced by implementation), I had similar problem with appcompat and downgrading to 27.0.2 solved for me
You can't use firebase-ui 1.2.0.
Check the compatibility here:
compile 'com.firebaseui:firebase-ui-database:3.3.1'
compile 'com.firebaseui:firebase-ui-storage:3.3.1'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
compile 'com.firebaseui:firebase-ui-auth:3.3.1'
Then use the same version of Google play services libraries and firebase libraries:
compile 'com.google.firebase:firebase-auth:15.0.0'
compile 'com.google.android.gms:play-services-auth:15.0.0'
compile 'com.google.firebase:firebase-database:15.0.0'

Version conflict between google-services and android-gms

I have module gradle dependencies like this
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.6.2'
implementation 'com.google.firebase:firebase-messaging:11.6.2'
implementation 'com.google.android.gms:play-services-gcm:11.6.2'
implementation 'com.google.android.gms:play-services-ads:11.6.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
and project gradle like this
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.2'
}
when i am syncing my project with gradle i am getting execution failed error
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.
But why? I have target SDK of 27, i am everywhere where i can already set to use latest packages, why studio asks me to downgrade com.google.android.gms to 11.4.2 ?
SDK Tools are
As mentioned by the OP, the line
apply plugin: 'com.google.gms.google-services'
must be moved to the bottom of the app module build gradle file. This line should come after all google gms dependencies.
Instead of
implementation 'com.android.support:appcompat-v7:+'
...
implementation 'com.google.firebase:firebase-core:11.6.2'
implementation 'com.google.firebase:firebase-messaging:11.6.2'
implementation 'com.google.android.gms:play-services-gcm:11.6.2'
implementation 'com.google.android.gms:play-services-ads:11.6.2'
use
implementation 'com.android.support:appcompat-v7:27.0.2'
...
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'

Excecution failed for task ':app:proccessDebugGoogleServices'

I am trying to connect my app with firebase analytics.
I have problem when Gradle tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar].
I have already put implement 'com.google.firebase:firebase-core:11.6.0' in build.gradle as following guide.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-ads:11.4.2'
}
apply plugin: 'com.google.gms.google-services'
gradle build finished with 1 error
Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.6.0.
Is anyone able to help me? Thank you in advance.
To solve this, this you need to add this line of code:
classpath 'com.google.gms:google-services:3.1.1'
In your dependencies from your build.gradle (Project) file.
Change also this line of code:
implementation 'com.google.android.gms:play-services-ads:11.4.2'
with
implementation 'com.google.android.gms:play-services-ads:11.6.0'
You have to use the same version of firebase libraries and google play service libraries:
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-ads:11.6.0'

Categories

Resources