Skip to content Skip to sidebar Skip to footer

Firebase Android Not Working Outside Testing Devices

I have this new app and have added Firebase Firestore and Cloud Firestore. User can sign up with email and pass, and log in successfully. Then user can enter birthday in myprofile

Solution 1:

When you make release builds for android typically proguard is used to obfuscate your code - this means renaming all your classes to things like A, B, C and all your variables to things like a, b, c, d, e. It looks like thats what could be happening here. You are uploading a data object like this:

data classPersonInfo(
    varbirthday: String = "",
    varemail: String = "",
    varid: String = "",
    varimage: String = "",
    varuserName: String = "" 
)

And proguard is obfuscating it to be something like:

data classA(
    vara: String = "",
    varb: String = "",
    varc: String = "",
    vard: String = "",
    vare: String = "" 
)

To tell proguard to not obfuscate a specific class you can add a rule in proguard-rules.pro (which should be located in you /app/ folder) like this:

-keep classyour.package.name.ClassName

This should preserve the original class and fix your issue (assuming the issue was from proguard as I suspect)

Post a Comment for "Firebase Android Not Working Outside Testing Devices"