NaingAungLuu / form-conductor

A declarative form validation for Jetpack Compose
https://formconductor.naingaungluu.me
MIT License
68 stars 5 forks source link

Consumer rules not being auto applied to proguard at consumer end #54

Open suhaibkazi opened 1 month ago

suhaibkazi commented 1 month ago

Hey,

Noticed in our release variants that proguard is stripping away some key functionalities of the form conductor, like stateless and statefull validation.

We are using both the UI and core library as our project is in compose

Thank you

suhaibkazi commented 1 month ago

Had to include it in my proguard manually What could be the issue?

NaingAungLuu commented 1 month ago

Hello Suhaib, The proguard rules are mandatory for the library to work in release mode,nif you're applying code minification or obfuscation using R8 or something.

This is because the library is using kotlin-reflect under the hood, requiring the syntax metadata to be available at run-time so that the validations can run.

Have you checked the documentation about which rules to include in the proguard rules file?

Here is the link:

https://formconductor.naingaungluu.me/docs/installation

Hope that helps!

suhaibkazi commented 1 month ago

Yes Naing, I was referring to this part of the documentation

"However, if you're using just me.naingaungluu.formconductor:core without compose-ui in your Android Project, you'll need to include the following proguard rules in your app module's proguard-rules.pro file."

I was thinking those rules would be auto applied as we are using the compose-ui too.

Regardless, it works after minification when explicitly rules are added