My firestore variables are saved by other names in cloud firestore. I think this is related to proguard, but I am not getting it.
Following are my username.
public String id;
public String name;
public String number;
public String profilePic;
public String shopPic;
and following is the screenshot, what is saved on firestore.

Here is some related code, which is very simple
        FirestoreUrls.get().getAccountsCollection()
                .document().set(binding.getUser()).addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                hideProgressBar();
                handleFirebaseException(getClass(), task, true);
            }
        });
You are experiencing this problem because you are using Proguard for security, which shuffles the code so others cannot see it right after you create the app's APK. This is also available in the case of Firebase. To solve this, please add the following lines of code in your build.gradle file:
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
Then add the following rules in your project's Proguard file to prevent that behavior by replacing the package name with your own package name:
-keepattributes Signature //Global rule
-keepclassmembers class com.example.YourModelClass.** {
  *;
}
Please check the docs for more information:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With