form-conductor icon indicating copy to clipboard operation
form-conductor copied to clipboard

Consumer rules not being auto applied to proguard at consumer end

Open suhaibkazi opened this issue 1 year ago • 3 comments

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 avatar Sep 10 '24 15:09 suhaibkazi

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

suhaibkazi avatar Sep 10 '24 16:09 suhaibkazi

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!

NaingAungLuu avatar Sep 10 '24 16:09 NaingAungLuu

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

suhaibkazi avatar Sep 12 '24 09:09 suhaibkazi