I have a project using firebase and the firebase auth ui library. The problem is I can't sign in using Google sign-in, when I try it loads for a second or two and then just shows a toast message saying "Developer Error". I can sign in with email and password just fine. And this is only a problem on signed apks, when I am debugging Google, sign-in works fine.
In my proguard-rules.pro I have minifyEnabled set to false.
And I have added the SHA-1 to my firebase project and have downloaded the correct json file.
dependency block from app level build.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.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 logcat shows no error or anything. I would post the logcat when this happens but I don't know how to get the logcat from a signed apk cause this only happens on sign the apk.
I have tried to figure this out for days but seem to be making no head way.
Thanks