WatermelonDB icon indicating copy to clipboard operation
WatermelonDB copied to clipboard

Issue using proguard and JSI on android

Open selven opened this issue 3 years ago • 3 comments

Hi, I've been fighting the "Uh-oh" error message that appears every time I turn on JSI. After a load of debugging, I've found that everything works ok if I turn off enableProguardInReleaseBuilds. Is this something anyone else has come across? Is there something I can add to proguard-rules.pro to be able to keep proguard on?

selven avatar Nov 27 '21 19:11 selven

-keep class com.nozbe.watermelondb.** { *; } Seems to work, is this a common issue? I can add it to the JSI installation steps

selven avatar Nov 27 '21 22:11 selven

@selven yes, can you please add this to install docs? I may have forgotten about this

radex avatar Nov 27 '21 22:11 radex

NB: Adding for google foo reasons

If you see this in your android logs Error: Cannot run database method because database failed to open and your app works fine in dev but breaks in productions (crashes on startup) and you have jsi + proguard this is likely your issue.

johnf avatar Mar 30 '22 02:03 johnf

It's in installation docs + added more helpful error message here: https://github.com/Nozbe/WatermelonDB/pull/1522

radex avatar Feb 03 '23 22:02 radex