Fixing version conflicts in Android studio - android

So I connected my app to Firebase, and they gave me this:
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.0.
Although this may sound weird, but i don't fully understand what they mean. This is my gradle code:
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.2'
compile 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
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'
}
apply plugin: 'com.google.gms.google-services'
Can someone please explain to me what the error message means and what I can do? How do i update this google.android.gms?
Help will be appreciated :-)

You should use the same version like, if firebasecore is 16.0.0
all other firebase should be the same 16.0.0
please correct this..in your app gradle :
{ compile 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'}
use it like this....
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.0'
Let me know it this work for u...

u should use same version otherwise it will conflict with other same support lib

Related

dependencies error when add firebase libraries

When add firebase in
dependencies
implementation 'com.google.firebase:firebase-core:16.0.6'
Or
implementation 'com.google.firebase:firebase-ads:17.1.2'
Or
implementation 'com.google.android.gms:play-services-ads:17.1.1
It shows error under implementation 'com.android.support:appcompat-v7:28.0.0' that All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
When I sync the app no error but when install the app it shows you app has been stopped (Crashing during run time).
When remove the firebase dependencies and run, my app it's working fine.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.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.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-ads:17.1.2'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
}
apply plugin: 'com.google.gms.google-services'
When you include dependencies, they too, will sometimes include dependencies of their own. Some of the firebase libraries happen to include support libraries at a lower version than 28. When you hover over the error message for appcompat-v7 it should tell you what library is lower than 28. You may have to click 'show more' on the error message. Once you figure out which one it is, include that exact same library but version 28. Resync your gradle and you're good to go. Also, you might have to do this multiple times because some firebase libraries include multiple lower version support libraries and the error message will only show you one library at a time.

can't not build my app due to an appcompat error

I just got the android studio and all I did was connecting with the firebase. But I was not able to fully connect because of the appcompat error. I have attached the photo of what I'm getting.
dependencies {
implementation fileTree(dir: 'libs',include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0' <--------------getting error here
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:11.6.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'
}
Error
Dependencies
I look at your error message and it felt familiar as i had received same message so many times!
Root cause is mixing version numbers in dependencies. it seems that in your dependencies you have version 28 and version 25 mixed up. go to build.gradle and put cursor on version number on each of your dependancies and then press ALT+ENTER. go with what android studio suggests and then clean->rebuild. it should work.
Hope this helps!

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

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.

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