0

I am using a @Valid annotation in a section of my code in Android Studio and it is being marked in red as en error.

After some research I have found that @Valid belongs to something called JSR-303.

I would like to know how to add this to my android project, I am having problems to find the compile or the package that needs to be added.

If that helps, the following line is also being marked in red:

import javax.validation.Valid;

Im my build.gradle I have:

compile 'javax.annotation:javax.annotation-api:1.2'
codeKiller
  • 5,493
  • 17
  • 60
  • 115

1 Answers1

0

The jsr 303 and the reference implementation Hibernate-Validator can be implemented in Android if you can get rid of a java.beans.Introspector dependency.

Please have a look at Is there a work around for the Android error "Unable to resolve virtual method java/beans/PropertyDescriptor"? and https://hibernate.atlassian.net/browse/HV-779

Source : Validation by annotations?

Community
  • 1
  • 1
vanurag
  • 297
  • 2
  • 19