About FireStore configuration in existing projects. [ANDROID]
I tried to include and configure it according to the support material and it did not work.
Error while adding dependencies in Gradle-App.
Dependency that is in the Firebase tutorial: compile 'com.google.firebase:firebase-firestore:11.0.6'
Note: I tried to put it as 10.2.6, and also tried to update all dependencies for the same version of FireStore. Nothing worked.
I currently have versions 10.2.6 of the Firebase services.
compile 'com.google.firebase:firebase-auth:10.2.6'
compile 'com.google.android.gms:play-services-auth:10.2.6'
compile 'com.google.android.gms:play-services:10.2.6'
compile 'com.google.firebase:firebase-database:10.2.6'
compile 'com.google.firebase:firebase-storage:10.2.6'
compile 'com.google.firebase:firebase-core:10.2.6'
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 10.2.6.
Note:
I checked the PlayService and Repository updates. And I also checked on the dependencies in Gradle:
classpath 'com.google.gms:google-services:3.1.0'
add
compile 'com.google.firebase:firebase-firestore:11.4.2'
You don't need com.google.firebase:firebase-database if you use Firestore alone.
and you don't need to compile all google services.
buildscript {
dependencies {
classpath 'com.google.gms:google-services:3.1.0'
}
}
dependencies {
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-firestore:11.4.2'
}
apply plugin: 'com.google.gms.google-services'
But if you want to change versions easier to avoid conflict you should use gradle "ext" :
buildscript {
ext.play_service_version = '11.4.2'
ext.firebase_version = '11.4.2'
dependencies {
classpath 'com.google.gms:google-services:3.1.0'
}
}
dependencies {
compile "com.google.android.gms:play-services-auth:${play_service_version}"
compile "com.google.firebase:firebase-auth:${firebase_version}"
compile "com.google.firebase:firebase-storage:${firebase_version}"
compile "com.google.firebase:firebase-core:${firebase_version}"
compile "com.google.firebase:firebase-firestore:${firebase_version}"
}
apply plugin: 'com.google.gms.google-services
Keep in mind that play-service-version and firebase-version should be the same.
Use compile 'com.google.firebase:firebase-firestore:11.4.2'
Cloud Firestore was introduced in Google Play services 11.4.2
Do not forget to add this line in the bottom of build.gradle:
apply plugin: 'com.google.gms.google-services'
How about your SDK versions?
it is in the build.gradle app level
make sure its the latest:
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
Related
I've searched for a lot of solutions to this, but none fit my exact case. I am getting this error on Gradle Sync:
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.4.2.
this is in my build.gradle (app) dependencies.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.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'
}
and this is in my Project level build.gradle
buildscript {
ext.kotlin_version = '1.2.10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also Important:
It shows a red line under this line:
implementation 'com.google.firebase:firebase-auth:11.8.0'
The message I'm getting if I hover over it:
All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.8.0, 11.4.2. Examples include com.google.android.gms:play-services-auth:11.8.0 and com.google.firebase:firebase-analytics:11.4.2
I don't even have an analytics dependency!
What do I do?
Already tried solutions:
If I try to change my com.google.android.gms version, it will throw me a lint saying not to bundle my entire play services in the dependencies. And it also doesn't change the firebase error I'm getting.
Changing firebase to 11.4.2 will throw a lint error.
Changing google play services version to 3.1.1 or below will do nothing.
If I am not wrong, Google services have the dependency on the firebase. I think both are conflicting
check this firebase.google.com/docs/android/setup and adjust google services and firebase dependency versions
Also, make sure you have this at the bottom of your build.gradle (app) file:
apply plugin: 'com.google.gms.google-services'
You might have some third party library in your project using the com.google.firebase:firebase-analytics:11.4.2 version of Analytics. Try to find that.
Try changing it from 11.8.0 to 11.4.2 works for me.
old values
implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
new values
implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
change this
implementation 'com.google.firebase:firebase-auth:11.8.0'
to
compile'com.google.firebase:firebase-auth:11.8.0'
and make sure that in your applevel build.gradle all google and firebase dependency version should be the same.
it doesnt works try removing google dependency from applevel build.gradle
Found com.google.android.gms:play-services:9.0.0, but version 8.3.0 is needed for the google-services plugin.
All the dependencies are at same level:
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile "com.google.firebase:firebase-messaging:9.0.0"
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
I have already tried to put this in the end (After dependencies)
apply plugin: 'com.google.gms.google-services'
Still Not working.
It's Giving me one error
Error:Execution failed for task ':app:processGpcaDebugGoogleServices'.
> 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 8.3.0.
Not able to find solution in other asked problems.
Update your classpath to point to the latest google-services version - it should be classpath 'com.google.gms:google-services:3.0.0':
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}
This is generally done in the topmost build.gradle file.
I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.
I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.
I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.