Android dependency error compile 'com.android.support:appcompat-v7:26.+' - android

This was working before I added firebaseui dependency. Now I'm getting this: log
Its red lining compile 'com.android.support:appcompat-v7:26.+' and when I hover over it, it says "all libraries must be exact same specification version". That version was what was there when the project was created.
app/build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.android.adarak"
minSdkVersion 21
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.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
//compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.firebaseui:firebase-ui:2.3.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

The firebaseui internally has a dependency on a specific version of Android support library. The firebase ui configuration contains 26.0.1 as the required support library version.
However your gradle file has a dependency on 26.+ which tells gradle to use the latest in the 26.x.x series and this could be different from 26.0.1. You can solve the issue by using the specific version required by firebase-ui (26.0.1)
Change the gradle file as shown below,
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'

Related

all com.android.libraries support must use same version when including play service in gradle

I just included ads into my app and as part of that process I included
/*google play plugin for adMob*/
compile 'com.google.android.gms:play-services:10.2.1'
as a dependency in my gradle app file. But I'm getting a red underscore error under
compile 'com.android.support:appcompat-v7:26.+'
error says:
all com.android.libraries support must use same version specification. mixing can lead to crashes.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "org.pctechtips.george.dailyquotes"
minSdkVersion 16
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'
/*firebase */
// compile 'com.google.firebase:firebase-core:10.2.1'
})
// compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
/*google play plugin for adMob*/
compile 'com.google.android.gms:play-services:10.2.1'
}
play-services-ads:10.2.1 has a dependency onto play-services-basement:10.2.1 which has a dependency onto com.android.support:support-v4:24.0.0. This is likely the source of the mismatch.
See All com.android.support libraries must use the exact same version specification for more context.

Failed to resolve: com.google.android.support.gms:play-services-map:10.2.0

I am trying to use the features from Google to create a google map but when I tried to sync the project I got this error
This is the build.gradle file..
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.chamiya.bustracking"
minSdkVersion 16
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'
})
// can update the Firebase
compile 'com.google.android.gms:play-services:11.4.2'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.firebaseui:firebase-ui-auth:1.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.support.gms:play-services-map:10.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Failed to resolve: com.google.android.support.gms:play-services-map:10.2.0
It happens because it doesn't exist:
Use:
compile 'com.google.android.gms:play-services-maps:x.x.x'
instead of
compile 'com.google.android.support.gms:play-services-map:10.2.0'
In any case in your build.gradle you have to change something:
you have to use the same version for the support firebase libraries and google play services libraries.
For example use the latest v11.8.0
compile 'com.google.android.gms:play-services:11.X.X'
compile 'com.google.firebase:firebase-database:11.x.x'
compile 'com.google.firebase:firebase-auth:11.x.x'
compile 'com.google.android.support.gms:play-services-map:11.x.x'
Update your compileSdkVersion
Use a compatibile version of the firebase-ui library.
Remove the apply plugin: 'com.google.gms.google-services' at the top of the file.

Install repository and sync project makes android studio freeze

I tried to get the latest version of the google play services for the maps api, using compile 'com.google.android.gms:play-services-maps:11.2.0' in the gradle file and also put the google maven url in the project gradle.
My problem is that when i try to sync my gradle files, i get an error and android studio proposes to install repository and sync project, but when i click on it nothing happens and android studio freezes for a few seconds.
The same happens if i add the whole google play services with compile 'com.google.android.gms:play-services:11.2.0'
I tried the invalidate cache/restart technique, i uninstalled/installed the google play service in the sdk manager and i don't know what to do to resolve this problem.
The build.gradle is like this (it works with the 11.0.4 version) :
apply plugin: 'com.android.application'
def dbflow_version = "4.0.5"
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "not telling"
minSdkVersion 21
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'
})
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.google.android.gms:play-services-identity:11.0.4'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
Do you have a way to fix this ?

Android Studio Error:Execution failed for task ':app:compileDebugJavaWithJavac'

I updated Android Studio and SDK tools to the latest version and now I got this error. I have updated Google Services and firebase dependencies accordingly. I tried to clean and rebuild the project but the result is same.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NullPointerException: element == null
Here is my gradle build:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.crisser.beitnaonline"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
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'
})
//noinspection GradleCompatible
compile('com.android.support:cardview-v7:23.2.0') {
force = true
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:11.0.0'
compile 'com.google.firebase:firebase-auth:11.0.0'
compile 'com.google.firebase:firebase-core:11.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile
'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.appolica:interactive-info-window:v1.0.6'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
}
apply plugin: 'com.google.gms.google-services'
Anyone knows why it does that? It worked just fine with 25.0.3.
You didn't compile corresponding dependency with annotation
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
Add this to your gradle file
compile 'com.github.bumptech.glide:glide:4.0.0'
I have gone through same issue. I just removed the dependency I added and my app began to work fine.
you should remove library one by one and build the application..

All com.android.support libraries must use the exact same version specification gradle issue

I am getting the issue All com.android.support libraries must use the exact same version specification when I am trying to sync my gradle file. Can any one please tell me the way by which I can solve my problem. I have already gone through this solution All com.android.support libraries must use the exact same version specification. but unfortunately it is not working in my case. Below is my gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.application"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
useLibrary 'org.apache.http.legacy'
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:recyclerview-v7:23.2.0'
compile 'org.altbeacon:android-beacon-library:2.+'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.android.gms:play-services-gcm:10.2.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Since you are using
compile 'com.google.android.gms:play-services-gcm:10.2.1'
You have a dependency with the support libraries v24.
In general you can use this command to check your dependencies tree.
./gradlew app:dependencies

Categories

Resources