This is the error message I am getting from this line: compile 'com.google.android.gms:play-services-ads:15.0.0' in the dependencies in my apps build.gradle:
All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 15.0.4, 15.0.1, 15.0.0. Examples include com.google.android.gms:play-services-measurement-base:15.0.4 and com.google.android.gms:play-services-ads-identifier:15.0.1
Anyone know how to get rid of this error message?
This is my app gradle file:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:4.0.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my build gradle file:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.app.company.app"
minSdkVersion 16
targetSdkVersion 25
versionCode 14
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-ads:15.0.0' //Error line
compile 'com.google.firebase:firebase-core:16.0.0'
compile 'com.crashlytics.sdk.android:crashlytics:2.9.3'
}
apply plugin: 'com.google.gms.google-services'
Pretty much exactly as it says. Your com.google.android.gms:play-service* dependencies should all be the same version.
If we could see the code/your gradle file, then that may help.~
It states you have 3 dependency versions...15.0.0,15.0.1 and 15.0.4.
They should all be the same (15.0.04 for example).
Looking at the maven repos, the most up to date for all that are a common version is 15.0.0.
You need to update google-service plugin to use:
classpath 'com.google.gms:google-services:3.3.0'
to be able to avoid those errors, also upgrade to android studio 3.1
If you're not using Android Studio 3.1 to develop your app, you will need to upgrade in order to get the correct version checking behavior within the IDE.
Related
BuildGrade in /src
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.amirqadir.finalchat"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
//compile 'com.android.support:design:26'
//firebase dependencies
//compile 'com.google.firebase:firebase-database '
compile 'com.google.android:design:26.0.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
}
Build Gradle of whole project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
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
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have tried everything none works I have tried installing repository etc.Its been 2 days I am stuck here
Is there anyway, I can surpass this as you can see in the above code I have used same version at every step but it still gives me error
I have seen somewhere they asked to add a dependency of google in build.gradle Which I already did as you can see
The latest support library version is 26.1.0 so make sure you change to this from 26.0.0.
Upgrade your gradle version for sdk 26. Make sure the dependencies in your top level build.gradle file looks like this:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
Also, the repositories should look like this:
allprojects {
repositories {
google()
jcenter()
}
}
Check your gradle/wrapper/gradle-wrapper.properties file. It should have this line:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Lastly, you can remove the attribute buildToolsVersion in app's build.gradle file as it is not required when you have the latest gradle version.
add the following at the end of the Module app build
apply plugin: 'com.google.gms.google-services'
and also update the google services and firebase plugins versions..
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
Please change the dependency
compile 'com.android.support:appcompat-v7:26.0.0'
into
compile 'com.android.support:appcompat-v7:26.+'
I'm building an android app to store a text file in the google drive.According to my perspective, the code is OK. But when I put the app level dependency of the google play-services, it throws an error in the app level version dependency. Due to this reason, I cannot sync the gradle. I think the error is with the version numbers.
here is the play service dependency I put
"compile 'com.google.android.gms:play-services:8.4.0'"
And this is the dependency that shows as an error when I put the above dependency
"compile 'com.android.support:appcompat-v7:23.4.0'"
Here is my app level graddle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.xxxxx.calllogtogoogledrive"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:8.4.0'
}
Here is the project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Could you try to change your build.gradle like this;
allprojects {
repositories {
maven { url "http://jcenter.bintray.com" }
}
Remove jcenter() add this.
I updated my android studio and my gradle will not sync
issues it gives me these errors. Im also using firebase as for authorization and database.I have tried deleting the gradle files and rebuilding but that didnt work. any suggestions would be appreciated.
Failed to resolve .com.android.support:support-v4:25.2.0
Failed to resolve com.android.support.test.espresso:espresso-core:2.2.2
Failed to resolve com.android.support:appcompat-v4:25.3.1
Failed to resolve com.android.support:mediarouter-V7:25.2.0
here is the build gradle for the project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here is my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.example.dude.sportspicks518"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
compile 'com.android.support:appcompat-v4:25.3.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:10.2.6'
}
apply plugin: 'com.google.gms.google-services'
several way to try
Invalidate Cache/Restart AS
Clean Project and Rebuild
Update "Google Repository" and "Android Support repository" in the Android SDK Manager.
if not working, then If you are trying to get the support repository, this is the correct import:
compile "com.android.support:support-v4:25.3.1"
If your compile api isn't 25, change the version to the latest with your compile api.
Android Studio should give you a yellow warning if you are using incompatible version. just hover it and use the suggestion given
P/s: Please please dont use com.google.android.gms:play-services.. it very heavy dex method count
I've added an empty google maps activity to my project in android studio but I'm receiving this error message:
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.0.1.
My app level build.gradle file contains:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "XXXXXXXXXX"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-maps:10.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
My project level build.gradle file contains:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
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
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
How can I resolve this issue? Any help is appreciated, thank you.
Update the packagecom.google.firebase:firebase-auth:10.0.1 to com.google.firebase:firebase-auth:10.2.0.
You should try using the same version of libraries based on play-services to avoid conflicts
Instead of using compile 'com.google.android.gms:play-services-maps:10.2.0' use this compile com.google.android.gms:play-services-maps:10.0.1'
I am setting up an Android server project for pushing notification using this documentation from Firebase website. At first, I have set up the project at Firebase console and added the JSON file & Google services plugin.
But while syncing the project after adding
compile 'com.google.firebase:firebase-server-sdk:3.0.1', there is the error:
Version: 3.0.1 is lower than the minimum version (9.0.0) required for google-services plugin.
My app build.gradle is-
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "ton.com.serverandroid"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.firebase:firebase-server-sdk:3.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
My project build.gradle is
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
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
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have tried to use google-services version 2.1.0 but it wasn't working either with the error:
Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ.
But I can't go farther in that case.
I answer a similar question today, you can see the correct dependences here enter link description here, this ones are most important to import other dependencies in android client. Then for server sdk you need to add this one in app.gradle:
compile 'com.google.firebase:firebase-server-sdk:[3.0.0,)'
For use FirebaseCloudMessaging you need other one in app.gradle:
compile 'com.google.firebase:firebase-messaging:9.0.0'
Tell us if you wan compile now, greetings!