Firebase Error: Incompatible Android SDK - android

I'm getting this error, but I'm not sure what I did wrong. I made sure I updated everything according to the instructions on the firebase website. Is this a compatibility error?
09-22 13:12:51.158 18083-18110/com.pingus.vent W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 10298480
Gradle Files:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.pingus.vent"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libraries', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-auth:10.0.2'
compile 'com.google.firebase:firebase-database:10.0.2'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'cn.pedant.sweetalert:library:1.3'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.github.jd-alexander:LikeButton:0.2.1'
}
apply plugin: 'com.google.gms.google-services'

You should use the same version for all Firebase services and Google play services as well, for example:
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
I used to use different versions for google play services and firebase services and got crashes.

Related

appcompat-v7:27.0.1 Issue with play-services-maps

I have this gradle
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.estimote:sdk:1.4.0'
compile 'com.android.support:appcompat-v7:27.0.1'
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true;
}
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.afollestad.material-dialogs:core:0.9.5.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.google.android.gms:play-services-location:11.6.0'
}
I have problem with appcompat-v7:27.0.1 and the google play services.
if I use the 26.0.1 there is not problem with the google play services but cant use the afollestand 0.9.5.0.
I need the afollestand 0.9.5.0 that works with appcompat-v7:27
UPDATE:
Gradle image
I've had the same problem. What user raghunandan suggested helps.
Using ./gradlew app:dependencies in your Apps folder ( or ./gradlew.bat app:dependencies on Windows), you get the dependency tree of all the packages.
There you can see that 'play-services-maps' requires some support packages with version 25.2.0, but most of them get upgraded to 27.0.2. But not all for some reason. You can do this manually though, by including them directly! (They will be part of your APK anyway)
compile 'com.android.support:support-v4:27.0.2'
add that in your apps build.gradle alongside support-v7 and it'll work.
I try Everything, but the real answer was wait to and update of play-services.
now my gradle looks like:
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "xxx.YYY"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://maven.google.com"
}
}
dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.afollestad.material-dialogs:core:0.9.6.0'
testCompile 'junit:junit:4.12'
And have 0 errors.

All com.android.support libraries must use the exact same version spec

I have a problem in build.gradle (Module app) that I can not resolve
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "ahmedchtn.smartschool"
minSdkVersion 17
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'
})
//RecyclerView
//retrofit,gson
//glide
compile 'com.github.bumptech.glide:glide:3.7.0'
//Displaying images
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v7:25.0.3'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
//Firebase UI
compile 'com.firebaseui:firebase-ui-auth:0.6.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
The error is shown in this line
compile 'com.android.support:appcompat-v7:23.4.0'
Error message:
All com.android.support libraries must use the exact same version specification(mixing versions can lead to runtime crashes).Found versions 25.3.1,23.4.0.Examples include
com.android.support:animated-vector-drawable:25.3.1 and
com.android.support:cardview-v7:23.4.0
Use same version to all dependencies of support libraries. In your case change these dependency version to "25.3.1".
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'

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..

Failed to resolve com.firebaseui:firebase-ui:0.5.3

I am new to Android-studio and Firebase.
I am trying to add Firebase UI dependency to my android project and ultimately plan to use FireBase facebook authentication UI.
But I get this message every time I try to sync.
Failed to resolve com.firebaseui:firebase-ui:0.5.3
I checked this link to see the versions but everything looked fine.
This is how my build.gradle looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.example.rohintak.firebasepractice"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// FirebaseUI Database only
//compile 'com.firebaseui:firebase-ui-database:0.5.3'
// FirebaseUI Auth only
//compile 'com.firebaseui:firebase-ui-auth:0.5.3'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.firebaseui:firebase-ui:0.5.3'
compile 'com.firebase:firebase-client-android:2.3.1'
}
apply plugin: 'com.google.gms.google-services'
You're including different versions of the Firebase SDK and FirebaseUI. That won't work.
Cleaned up dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.firebaseui:firebase-ui-auth:0.5.3'
}

"Method references in a .dex file cannot exceed 64K" after changing build.gradle

I'm getting that error that says I have too many method references:
Error:The number of method references in a .dex file cannot exceed 64K.
It all started when I tried to change my targetSdkVersion to 24 and minSdkVersion to a lower sdk (19) via the gradle app file. That led me to having to change some values throughout the file like
compile 'com.android.support:appcompat-v7:23.0.0'
to
compile 'com.android.support:appcompat-v7:24.1.1'
I've read that people get this error when they have the wrong values in build.gradle. Here was my original build.gradle before the changes:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.delbridge.seth.alarm"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
Any thoughts as to what's causing this?
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.google.firebase:firebase-ads:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
And here is my build.gradle currently:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.delbridge.seth.alarm"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
}
apply plugin: 'com.google.gms.google-services'
You're unnecessarily including all of Google Play Services with this line:
compile 'com.google.android.gms:play-services:9.4.0'
So, remove that line and leave the ones that include the individual components:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.jsoup:jsoup:1.9.2'
compile 'org.jdeferred:jdeferred-android-aar:1.2.4'
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
//remove this line:
//compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
}
Note:
If the above solution does not solve your issue, then you will need to enable multidex.
try this in your build.gradle file:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 14 //lower than 14 doesn't support multidex
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
check this page: https://developers.google.com/android/guides/setup
and use needed google play service

Categories

Resources