Mohammad Mohammad - 6 months ago 273
Android Question

Gradle sync failed: Version: 8.4.0 is lower than the minimum version (9.0.0) required for google-services plugin

I'm trying to integrate Google's Firebase SDK as explained here

But I'm getting this error when I try to build the project:

Gradle sync failed: Version: 8.4.0 is lower than the minimum version (9.0.0) required for google-services plugin.


This is my project's
build.gradle
file :

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}

allprojects {
repositories {
jcenter()
}
}


and this is app's
build.gradle
file:

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'

repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
lintOptions {
abortOnError false
}
signingConfigs {
release {
}
}
compileSdkVersion Integer.parseInt(project.COMPILE_SDK_VERSION)
buildToolsVersion project.BUILD_TOOLS_VERSION
defaultConfig {
applicationId 'club.androidy.callcontrolfree'
minSdkVersion project.MIN_SDK
targetSdkVersion project.TARGET_SDK_VERSION
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
productFlavors {
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:design:23.3.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-crash:9.0.0'
}
apply plugin: 'com.google.gms.google-services'


What's wrong here?

Thanks in advance.

Answer

As you are using

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

You have to use the version 9.0.0 of the google play service.

Change your dependencies:

compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'