I'm using the new version 0.4.1 of the auth library (on a device with Android 6.0.1).
I'm trying to use the Google sign in provider, launching this intent:
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(
AuthUI.EMAIL_PROVIDER,
AuthUI.GOOGLE_PROVIDER)
.build(),
RC_SIGN_IN);
When i login with email&password everythings works fine, but when i try to login with the google sign in button, i select the account and i can see a loader for about 3-4 seconds: then the loader disappears and nothing else happens, i still remain into the activity with the two login buttons.
onActivityResult isn't fired and i don't know if login was successful or not.
Thanks.
Just update to 0.4.1 - same issue. Cancel result fires on a back button.
Same issue, but it was my fault. Check in your build.gradle this dependencies
compile 'com.google.firebase:firebase-auth:9.0.2'
NOTE: Developers need a warning if missing!
i have compile 'com.google.firebase:firebase-auth:9.0.2' in build.gradle, but still have this issue
@Fax3D have you added your SHA1 and package name in the Firebase console and downloaded the google-services.json file in the right place? Google Sign In (GSI) requires SHA1/package match but email and password does not, so this failure implies there is something wrong with your GSI configuration.
Hi @samtstern, yes i've added my SHA1 and i've downloaded the google-services.json in the right place. In the older version 0.4.0 was right, only with the new 0.4.1 i see this issue.
And, i have compile 'com.google.firebase:firebase-auth:9.0.2' in build.gradle
Thanks
I had this problem too! Turned out it was caused by not having internet connectivity on the device. The email auth provider would then throw an internal error and the activity would not finish.
I'm having this issue. Anyone find a good work around?
@Fax3D do you see anything in the logs like "Firebase sign in with credential unsuccessful" or any mention of error code 12501?
I'm actually having the same issue, using 9.0.2 with 0.4.1. I can login fine with email, but not Google . I do not get anything back in the onActivityResult
I'm having the same issue as @tehras
@tehras @NicholasSTG did you enable Google Auth in the 'providers' tab of the Firebase Console? Did you enter the correct SHA1 and package name?
I did on both accounts. I also just double checked the console and my google-services.json account to make sure.
@nichola I was missing the Google play services auth library
@tehras it seems that was my issue as well; once I did that and updated a few other libraries (and rebuilt the heck out of the project) it seems to be working.
Looks like @tehras and @NicholasSTG have solved their issue. @Fax3D is the issue persisting for you? If not we can close this issue.
Hi @samtstern, i've just checked my configuration like proposed by @tehras and @NicholasSTG and seems to be ok, it's all up to date and i've already play services auth library... and the issue still persist!
Tomorrow i'll paste here my logcat trace to help you find this issue.
Thanks!
Hi @samtstern,
looking into logs, i found this exception:
Class not found when unmarshalling: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
java.lang.ClassNotFoundException: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at android.os.Parcel.readParcelableCreator(Parcel.java:2275)
at android.os.Parcel.readParcelable(Parcel.java:2239)
at android.os.Parcel.readValue(Parcel.java:2146)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:918)
at android.content.Intent.getStringExtra(Intent.java:5386)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1780)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1334)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4802)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4639)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:142)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3139)
at android.os.Binder.execTransact(Binder.java:446)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.signin.internal.SignInConfiguration" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method)聽
at java.lang.Class.forName(Class.java:308)聽
at java.lang.Class.forName(Class.java:272)聽
at android.os.Parcel.readParcelableCreator(Parcel.java:2275)聽
at android.os.Parcel.readParcelable(Parcel.java:2239)聽
at android.os.Parcel.readValue(Parcel.java:2146)聽
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)聽
at android.os.BaseBundle.unparcel(BaseBundle.java:221)聽
at android.os.BaseBundle.getString(BaseBundle.java:918)聽
at android.content.Intent.getStringExtra(Intent.java:5386)聽
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1780)聽
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1334)聽
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4802)聽
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4639)聽
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:142)聽
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3139)聽
at android.os.Binder.execTransact(Binder.java:446)聽
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
I see the same issue, but on a Samsung S6 only (G920F / Android 6.0.1).
My app works just fine on several other devices (3x Nexuses, 2x Sony).
The google registration works OK but the onActivityResult() callback is never fired.
That's a major issue since my app is doing some mandatory initializations in this callback...
In my case, I just had not added the correct SHA key to the Google Services json and it works now. Would be nice to get an error message though....
This issue still persist in version 0.4.3... anyone?
Thanks.
I was chasing down a similar bug for a long time, but it was an issue with my activity lifecycle.
I had some code in my onStart() method which checked if a user was logged in, and if so moved to another activity. This was bypassing the onActivityResult() method.
Moving my log in check into the onResume() method allowed onActivityResult() to be fired properly.
FYI, I was following this guidance, which does not specify what part of the Activity lifecycle is best to check the log in status. It was my fault that I didn't know whe onActivityResult() is called!
https://firebase.google.com/docs/auth/android/manage-users#get_the_currently_signed-in_user
Hi
I am using Firebase UI 0.4.4 and Play Services 9.4.0
//Google Play Services
compile 'com.google.android.gms:play-services:9.4.0'
//Firebase UI
compile 'com.firebaseui:firebase-ui:0.4.4'
onActivityResult is not being fired, Facebook and Email auth is working fine.
But when I tap on Google Login after asking email-id it just goes away and don't fire onActivityresult.
I have added SHA-1 key and also enabled google login in firebase console, plus google json config file is updated and at right place.
Please any can help?
Here is the log's but I am unable to get a hint of whats happening...
08-04 11:17:36.738 23903-23903/com.phoenixapplabs.learnpython E/Typeface: SANS_LOC file not found.
08-04 11:17:37.228 23903-23903/com.phoenixapplabs.learnpython D/FindExtension: FindExtension: before mHardwareRenderer.initialize, mSurface.isValid() = true
08-04 11:17:37.248 23903-23903/com.phoenixapplabs.learnpython D/FindExtension: FindExtension: before mHardwareRenderer.initialize, mSurface.isValid() = true
08-04 11:17:37.949 23903-23903/com.phoenixapplabs.learnpython W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-04 11:17:37.959 23903-23903/com.phoenixapplabs.learnpython E/Typeface: SANS_LOC file not found.
08-04 11:17:38.109 23903-23903/com.phoenixapplabs.learnpython D/AutoManageHelper: starting AutoManage for client 1 false false
08-04 11:17:38.149 23903-23903/com.phoenixapplabs.learnpython D/AutoManageHelper: onStart true {1=com.google.android.gms.internal.zzpk$zza@380a7ac6}
08-04 11:17:38.209 23903-23903/com.phoenixapplabs.learnpython D/FindExtension: FindExtension: before mHardwareRenderer.initialize, mSurface.isValid() = true
08-04 11:17:44.486 23903-23903/com.phoenixapplabs.learnpython D/FindExtension: FindExtension: before mHardwareRenderer.initialize, mSurface.isValid() = true
08-04 11:17:44.546 23903-23903/com.phoenixapplabs.learnpython E/Typeface: SANS_LOC file not found.
08-04 11:17:44.606 23903-23903/com.phoenixapplabs.learnpython D/FindExtension: FindExtension: before mHardwareRenderer.initialize, mSurface.isValid() = true
08-04 11:17:45.877 23903-23959/com.phoenixapplabs.learnpython I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:3 and remote module com.google.android.gms.tagmanager:3
08-04 11:17:45.877 23903-23959/com.phoenixapplabs.learnpython I/DynamiteModule: Selected local version of com.google.android.gms.tagmanager
08-04 11:17:46.678 23903-23927/com.phoenixapplabs.learnpython W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-04 11:17:47.359 23903-23959/com.phoenixapplabs.learnpython W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
08-04 11:17:47.359 23903-23959/com.phoenixapplabs.learnpython I/GoogleTagManager: Tag Manager initilization took 1402ms
08-04 11:17:51.333 24866-24866/com.phoenixapplabs.learnpython:background_crash W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
08-04 11:17:51.333 24866-24866/com.phoenixapplabs.learnpython:background_crash W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
08-04 11:17:51.303 24866-24866/com.phoenixapplabs.learnpython:background_crash I/MultiDex: VM with version 2.1.0 has multidex support
08-04 11:17:51.303 24866-24866/com.phoenixapplabs.learnpython:background_crash I/MultiDex: install
08-04 11:17:51.303 24866-24866/com.phoenixapplabs.learnpython:background_crash I/MultiDex: VM has multidex support, MultiDex support library is disabled.
08-04 11:17:51.303 24866-24866/com.phoenixapplabs.learnpython:background_crash E/Typeface: SANS_LOC file not found.
08-04 11:17:51.303 24866-24866/com.phoenixapplabs.learnpython:background_crash I/MultiDex: install
08-04 11:17:51.303 24866-24866/com.phoenixapplabs.learnpython:background_crash I/MultiDex: VM has multidex support, MultiDex support library is disabled.
08-04 11:17:51.313 24866-24866/com.phoenixapplabs.learnpython:background_crash W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
08-04 11:17:51.373 24866-24866/com.phoenixapplabs.learnpython:background_crash D/ChimeraCfgMgr: Reading stored module config
08-04 11:17:51.393 24866-24866/com.phoenixapplabs.learnpython:background_crash I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:3
08-04 11:17:51.393 24866-24866/com.phoenixapplabs.learnpython:background_crash I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 3
08-04 11:17:51.413 24866-24866/com.phoenixapplabs.learnpython:background_crash D/ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a
08-04 11:17:51.413 24866-24866/com.phoenixapplabs.learnpython:background_crash I/art: DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/data@[email protected]@app_chimera@m@0000000b@[email protected]' for file location '/data/data/com.google.android.gms/app_chimera/m/0000000b/DynamiteModulesC_GmsCore_prodlmp_xxhdpi_release.apk': Failed to open oat filename for reading: No such file or directory
08-04 11:17:51.443 24866-24866/com.phoenixapplabs.learnpython:background_crash D/ChimeraFileApk: Classloading successful. Optimized code found.
08-04 11:17:51.453 24866-24866/com.phoenixapplabs.learnpython:background_crash I/FirebaseCrashReceiverServiceImpl: FirebaseCrashReceiverServiceImpl created by ClassLoader com.google.android.chimera.container.internal.DelegateLastPathClassLoader[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/0000000b/DynamiteModulesC_GmsCore_prodlmp_xxhdpi_release.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]
08-04 11:17:51.463 24866-24866/com.phoenixapplabs.learnpython:background_crash D/FirebaseCrashReceiverServiceImpl: onCreate
08-04 11:17:51.483 24866-24866/com.phoenixapplabs.learnpython:background_crash I/DynamiteModule: Considering local module com.google.android.gms.flags:0 and remote module com.google.android.gms.flags:1
08-04 11:17:51.483 24866-24866/com.phoenixapplabs.learnpython:background_crash I/DynamiteModule: Selected remote version of com.google.android.gms.flags, version >= 1
08-04 11:17:51.523 24866-24866/com.phoenixapplabs.learnpython:background_crash I/FirebaseCrashSenderServiceImpl: FirebaseCrashSenderServiceImpl created by ClassLoader com.google.android.chimera.container.internal.DelegateLastPathClassLoader[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/0000000b/DynamiteModulesC_GmsCore_prodlmp_xxhdpi_release.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]
08-04 11:17:51.533 24866-24866/com.phoenixapplabs.learnpython:background_crash D/FirebaseCrashSenderServiceImpl: onCreate
I was struggling with this for a while and I had a combination of factors (some may be irrelevant but I caught them when debugging this issue nevertheless):
apply plugin: 'com.google.gms.google-services' not being at the bottom of the build.gradle file (had it at the top instead). Read here.google-services.json file. I had two android apps on the same Firebase project each with a different package name. Even though I downloaded the correct google-services.json file from the Project Settings page, the file being downloaded was always for the first app I created (probably a bug in the Firebase Console). I had to delete both my apps (not the project) and create a new app to get the correct file.Hope this helps.
Any login method makes my app to close. No error msg is printed. It just closes.
I am having the same reaction as fabriciointerama.
Upon entering the email/name/password and then pressing next it closes my app to the background. Bringing the app back to the foreground just runs through the lifecycle where it eventually hits the start up check to see if a user is logged in. Since the authentication was successful it forwards to the main activity but this means that onActivityResult is never ever triggered. This is quite annoying.
Further working with this, Google login lets me select an account, and then the dialog closes and nothing, it just sits on the screen to choose facebook/google/email login. Facebook login gives me an error saying my app id is change me when I created my facebook app id string in my string resources file, I assume it isn't looking for it.
Hi, we encountered the same issue.
However, we noticed a strange behaviour. We are working with 2 different computers:
We encountered the problem only on the second one (with JDK 1.8): is there anyone who experienced the issue with JDK 1.7? Or, is there anyone that is able to login with an app compiled on a pc that runs JDK 1.8?
@tmontanaro Thanks for the comment! I have a bunch of questions which might help get to the bottom of this. Are you seeing this when using sign in with google Google like @Fax3D? Can you log in using other providers? Are you running in an emulator, or are you seeing this on a device? I have JDK 1.8 installed and it works for me so unfortunately I think that may not be the issue.
Hello, I will answer to your question in a list to avoid misanderstanding.
@tmontanaro although this does seem to be device specific for you, the computer can also matter because each machine will have its own debug keystore and therefore require a different SHA1 registration (unless you are explicitly sharing the keystore across machines).
Hello, I must apologize: all our (my and my team's) problems were related to the keystore (thank you very much @samtstern ... without you we would have continued to try without success): one of our colleagues changed the SHA1 code on firebase for some personal trials (without warning us) and then we started to have problems.
Even though I cannot understand why on one smartphone it worked even with the wrong key, now, after updating all key related settings (SHA1 on firebase, google-services.json in the app) the login works with all the devices.
Thank you again and sorry!
I'm having the same issue as @fabriciointerama however, the most strange thing is that my login process works perfectly fine in Facebook, Gmail and normal email. Even signing anonymously works.
But right after the login is successful, my app (not the activity) is moved to the background. I have to see the apps in the background, and after selecting my app, it resumes the activity that fired the login process (which is my starting activity) and it continues to the main activity.
So login is working perfectly fine. I see the emails that have logged in for all those authentication providers. But the app gets closed immediately after log in, leaving me at the desktop.
I'm using the latest versions for the dependencies. This is my app build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'maven'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath "io.fabric.tools:gradle:$fabric_version"
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.mypackage.debug"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
debug {
minifyEnabled false
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
/**
* The 'initWith' property allows you to copy configurations from other build types,
* so you don't have to configure one from the beginning. You can then configure
* just the settings you want to change. The following line initializes
* 'jnidebug' using the debug build type, and changes only the
* applicationIdSuffix and versionNameSuffix settings.
*/
jnidebug {
// This copies the debuggable attribute and debug signing configurations.
initWith debug
applicationIdSuffix ".jnidebug"
jniDebuggable true
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
def room_version = "2.0.0"
implementation "com.android.support:design:$android_dependencies_version"
implementation 'androidx.arch.core:core-runtime:2.1.0-beta01'
implementation "androidx.appcompat:appcompat:1.1.0-alpha05"
implementation 'androidx.annotation:annotation:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.filosganga:geogson-core:1.2.21'
implementation 'com.github.filosganga:geogson-jts:1.2.21'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.facebook.android:facebook-android-sdk:5.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
transitive = true
}
implementation 'io.swagger:swagger-annotations:1.5.21'
implementation 'org.apache.httpcomponents:httpcore:4.4.11'
implementation 'org.apache.httpcomponents:httpmime:4.5.8'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.27.0-eap13'
implementation 'com.carto:carto-mobile-sdk:4.1.6@aar'
implementation 'com.mapzen.android:lost:3.0.4'
implementation 'com.graphhopper:directions-api-client-hc:0.10.3'
implementation 'com.andkulikov:transitionseverywhere:2.0.0-beta01'
implementation 'com.flickr4java:flickr4java:3.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:3.1.0-alpha'
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13-beta-2'
testImplementation 'org.robolectric:robolectric:4.3-alpha-2'
testImplementation 'net.jodah:concurrentunit:0.4.4'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.lifecycle:lifecycle-extensions:$room_version"
testImplementation "androidx.room:room-testing:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation 'com.github.humazed:RoomAsset:1.0.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
implementation 'com.jmedeisis:draglinearlayout:1.1.0'
implementation 'io.github.kobakei:ratethisapp:1.2.0'
implementation 'org.jetbrains.anko:anko-common:0.9'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.yarolegovich:discrete-scrollview:1.4.9'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation "com.google.android.gms:play-services-auth:16.0.1"
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
}
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
task instrumentTest(dependsOn: connectedCheck)
apply plugin: 'com.google.gms.google-services'
Yesterday I forgot to mention that I had reviewed @janakagamini comment, so just to double check and discard possible missing configurations, here is the 'whole' picture:
So summarizing my situation again, apparently the configuration is all right. However, after a successful login, my app moves to the background, leaving me at the desktop of my Android emulator (tested as well on a physical device with the same result).
I'm using the default Firebase Auth UI. The code I use to start the activity is this one:
override fun onResume() {
super.onResume()
val mAuth = FirebaseAuth.getInstance()
val currentUser = mAuth?.currentUser
if (currentUser == null) {
requireFirebaseLogin()
}
}
private fun requireFirebaseLogin() {
val providers = arrayListOf(
AuthUI.IdpConfig.AnonymousBuilder().build(),
AuthUI.IdpConfig.EmailBuilder().build(),
AuthUI.IdpConfig.FacebookBuilder().build(),
AuthUI.IdpConfig.GoogleBuilder().build())
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.setLogo(R.mipmap.logo)
.build(),
RequestCodes.FIREBASE_SIGN_IN)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == RequestCodes.FIREBASE_SIGN_IN) {
val response = IdpResponse.fromResultIntent(data)
if (resultCode == Activity.RESULT_OK) {
mapApplication.firebaseAuth = mAuth
initSetup()
} else {
// Sign in failed. If response is null the firebaseAuth canceled the
// sign-in flow using the back button. Otherwise check
// response.getError().getErrorCode() and handle the error.
}
}
}
@dcalano did you solve your problem? It definitely seems mine is like yours.
I'm facing similar behaviour.
Changing
implementation "androidx.appcompat:appcompat:1.1.0-alpha05"
to
implementation "androidx.appcompat:appcompat:1.0.2"
solves the issue. I hope appcompat library will be fixed soon.
I was having this issue because I had set no history for the activity calling the firebase ui in the manifest file. Removing android:noHistory="true" from the activity inside manifest solved the problem
@itrevex actually I have the noHistory attribute set to true. Thanks for this valuable data!
Although at the end I built my own customized login / sign up process using the Firebase library.
Actually make sure that private static final int RC_SIGN_IN =1 ;
not -1
Most helpful comment
Any login method makes my app to close. No error msg is printed. It just closes.