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

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'
}

Related

Cannot build project because of error in Android studio

i have the following error:
Build gradle file is following:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.bln.smc"
minSdkVersion 18
targetSdkVersion 23
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'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-storage:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'com.android.support:design:23.0.3'
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:recyclerview-v7:23.0.1'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
I researched a little bit and i think that the settings in the gradle file are ok.
So how can i solve this problem?
This is because you have conflicted dependencies in your build.gradle. Firebase UI need version 25 of support library but your dependencies is giving it version 23 instead.
If you want to use firebase-ui:1.2.0, you at least need to use support library version 25.1.1. Take a look at firebase-ui 1.2.0 build.gradle.
Then, you also need to use a compatible Firebase/Google Play Service version. For firebase-ui:1.2.0 you need to use Firebase/Google Play service version 10.2.0.
My suggestion is to use the latest configuration. Something like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.bln.smc"
minSdkVersion 18
targetSdkVersion 26
...
}
...
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
// This is needed for firebase UI
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'
compile 'com.google.firebase:firebase-crash:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.firebaseui:firebase-ui:3.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

Firebase Error: Incompatible Android SDK

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.

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

Cannot resolve symbol 'GoogleApiClient' after adding the Firebase dependency

compile 'com.google.firebase:firebase-database:10.2.0'
After I added this dependency, the problem occurs. Before that, the GoogleApiClient works fine. I remove that dependency, the problem is solved. Do GoogleApiClient and Firebase have conflict about each other? Please help.
EDIT: Gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "application.id"
minSdkVersion 16
targetSdkVersion 22
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'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.firebase:firebase-database:10.2.0'
}
GoogleApiClient and firebase-database will work, if you add below dependencies,
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
firebase-database dependency will not affect GoogleApiClient
Please keep same versions for firebase & Google Play Services API(10.2.0)
Please re-check you have set up everything as below guidance,
https://firebase.google.com/docs/android/setup

"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