codelab-friendlychat-android icon indicating copy to clipboard operation
codelab-friendlychat-android copied to clipboard

App crashes when enabling proguard

Open jkasnicki opened this issue 6 years ago • 2 comments

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.

jkasnicki avatar Apr 03 '18 19:04 jkasnicki

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

vegatroz avatar Jun 24 '18 08:06 vegatroz

In my case I forgot to add a proguard rule to keep the model classes:

-keep class com.google.firebase.example.fireeats.model.** { *; }

imrankst1221 avatar Jun 21 '19 16:06 imrankst1221