codelab-friendlychat-android
codelab-friendlychat-android copied to clipboard
App crashes when enabling proguard
Repro steps: Set minifyEnabled to true
Expected behavior: App continues to work
Actual behavior: App crashes on startup with error like: com.google.firebase.database.d: No properties to serialize found on class com.google.firebase.codelab.friendlychat.a
com.google.firebase.codelab.friendlychat.a is the FriendlyMessage class.
Annotating that class w/ @Keep locally works. Something like https://github.com/firebase/quickstart-android/blob/master/database/app/proguard-rules.pro may also work.
I got this error too, and find someone's suggestion in this forum Just type below code to FriendlyMessage.java under Public Class FriendlyMessage : public FriendlyMessage() {}
It solved my problem
In my case I forgot to add a proguard rule to keep the model classes:
-keep class com.google.firebase.example.fireeats.model.** { *; }