I have a project using firebase and firebase auth ui library. The problem is that I can’t log in using Google login when I try to download it for a second or two, and then just displays a toast message with the message “Developer error”. I can login with email and password. And this is only a problem with signed apks, when I debug Google, the login is working fine.
In my proguard-rules.pro my minifyEnabled is set to false.
And I added SHA-1 to my firebase project and uploaded the correct json file.
build.gradle application level block
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.2' compile 'com.android.support:design:26.0.2' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support:design:26.0.2' compile 'com.android.support:cardview-v7:26.0.2' compile 'com.google.firebase:firebase-database:11.4.2' compile 'com.google.firebase:firebase-auth:11.4.2' compile 'com.firebaseui:firebase-ui-auth:3.1.0' testCompile 'junit:junit:4.12' } apply plugin: 'com.google.gms.google-services'
here is my AuthStateListener
mAuthStateListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { FirebaseUser user = firebaseAuth.getCurrentUser(); if (user != null) { signedInInitialized(); } else { signedOutCleanUp(); startActivityForResult( AuthUI.getInstance() .createSignInIntentBuilder() .setTheme(R.style.FirebaseSignInTheme) .setIsSmartLockEnabled(false) .setAvailableProviders( Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(), new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build())) .build(), RC_SIGN_IN); } } };
The log code does not show any errors. I would publish logcat when this happens, but I don’t know how to get logcat from a signed apk, because it only happens with the apk sign.
I tried to figure this out for a few days, but didn't seem to make the headway.
thanks
source share