Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaripaarViolationException #225

Open
Savrov opened this issue Oct 19, 2018 · 2 comments
Open

SaripaarViolationException #225

Savrov opened this issue Oct 19, 2018 · 2 comments

Comments

@Savrov
Copy link

Savrov commented Oct 19, 2018

I have a code inside androidx.fragment.app.Fragment

@Password(min = 3)
EditText etPassword;

After init validation

validator = new Validator(this);
validator.setValidationMode(Validator.Mode.IMMEDIATE);
validator.setValidationListener(this);

And on validator.validate(); I receive:

SaripaarViolationException: 'com.mobsandgeeks.saripaar.rule.PasswordRule' should have a single-argument constructor that accepts a 'com.mobsandgeeks.saripaar.annotation.Password' instance.

Pls help to fix

@Asad-Khan-Aasanjobs
Copy link

@Savrov

I'm getting this error as well.

IMO It is most probably because of the instantiateRule() method in Reflector.java class, which throws this violation error when trying to create the validation rule with any available public constructors through reflection.

I tried debugging this and found that no constructors are returned, even after adding a public constructor to my Annotation Rule class.

This only happens when I'm using proguard, but I've added these lines to my proguard.pro file:
-keep class com.mobsandgeeks.saripaar.** {*;} -dontwarn com.mobsandgeeks.saripaar.**
Still this is happening.
Can some help here?

@Savrov
Copy link
Author

Savrov commented Oct 22, 2018

@Asad-Khan-Aasanjobs I have created new project with AndroidX support (again) and it works. In old project its not still working.

Its smth with project build...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants