Mohammad Alaa
Mohammad Alaa

Reputation: 63

Firebase Authentication failed in release mode

In my debug android app I made a sign in into firebase with google and facebook and it worked well, but after generating signed APK it's not working, I updated SHA1 in firebase project with release SHA and updated key hash in facebook for developers also but it still not working what can I do.

Upvotes: 4

Views: 2610

Answers (3)

Henu
Henu

Reputation: 1742

Most of the times things like this happens because of proguard, it removes some of the files when building apk. Check if it works when proguard is disabled. if it works then try to configure proguard to keep all required files.

To disable proguard set minifyEnabled false in build.gradle after changing it will look somewhat like

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled false 
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

}

To further configure proguard you can easily find tutorial on google. Some helpful links:-

https://stackoverflow.com/a/26274623/5176343

https://stackoverflow.com/a/15761408/5176343

Upvotes: 2

Mahendra Dabi
Mahendra Dabi

Reputation: 113

Have you selected a build version to release and than generate singed apk i hope this will work for you.

Upvotes: 0

Daniel
Daniel

Reputation: 56

It's tough to say without seeing the code, but one thing that has worked for me in the past was turning off proguard and/or minify in build.gradle. Those things were changing property names in the release apk for me which then caused de-serialization to fail for me because the names didn't match what was in the json.

Upvotes: 0

Related Questions