在Android上,找不到用于休眠验证器的bean验证提供程序。
runtimeOnly group: 'org.hibernate', name: 'hibernate-validator', version: '6.1.2.Final'
runtimeOnly group: 'org.glassfish', name: 'javax.el', version: '3.0.0'
Validation.buildDefaultValidatorFactory()
返回null。
它确实适用于Java SE8。
Android 8.0,API 26。
尝试过Apache Bean验证程序:
runtimeOnly group: 'org.apache.bval', name: 'bval-jsr', version: '2.0.3'
错误
java.lang.NoSuchMethodError: No virtual method getAnnotatedInterfaces()
[Ljava/lang/reflect/AnnotatedType; in class Ljava/lang/Class; or its super
classes (declaration of 'java.lang.Class' appears in /system/framework/core-oj.jar)