gpt4 book ai didi

android - Saripaar 由 : java. lang.NoSuchFieldException 引起:LONG

转载 作者:太空狗 更新时间:2023-10-29 15:00:41 27 4
gpt4 key购买 nike

您好,我在使用混淆器的发行版中遇到问题。在调试中一切正常。当我尝试打电话时:验证器.validate();他们抛出:

java.lang.NoSuchFieldError
at libcore.reflect.AnnotationAccess.decodeValue(AnnotationAccess.java:688)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:663)
at libcore.reflect.AnnotationAccess.annotationSetToAnnotations(AnnotationAccess.java:633)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotations(AnnotationAccess.java:161)
at java.lang.reflect.Field.getDeclaredAnnotations(Field.java:234)
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:104)
at com.mobsandgeeks.saripaar.Validator.getViewFieldsWithAnnotations(SourceFile:478)
at com.mobsandgeeks.saripaar.Validator.getSaripaarAnnotatedFields(SourceFile:453)
at com.mobsandgeeks.saripaar.Validator.validateAllRules(SourceFile:346)
at com.mobsandgeeks.saripaar.Validator.validate(SourceFile:156)
at pl.someclass.fragment.RegistrationFragment$1.onClick(SourceFile:92)
at android.view.View.performClick(View.java:4756)
at android.view.View$PerformClick.run(View.java:19749)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.NoSuchFieldException: LONG
at java.lang.Class.getDeclaredField(Class.java:886)
at libcore.reflect.AnnotationAccess.decodeValue(AnnotationAccess.java:685)
... 20 more
java.lang.NoSuchFieldException: LONG
at java.lang.Class.getDeclaredField(Class.java:886)
at libcore.reflect.AnnotationAccess.decodeValue(AnnotationAccess.java:685)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:663)
at libcore.reflect.AnnotationAccess.annotationSetToAnnotations(AnnotationAccess.java:633)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotations(AnnotationAccess.java:161)
at java.lang.reflect.Field.getDeclaredAnnotations(Field.java:234)
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:104)
at com.mobsandgeeks.saripaar.Validator.getViewFieldsWithAnnotations(SourceFile:478)
at com.mobsandgeeks.saripaar.Validator.getSaripaarAnnotatedFields(SourceFile:453)
at com.mobsandgeeks.saripaar.Validator.validateAllRules(SourceFile:346)
at com.mobsandgeeks.saripaar.Validator.validate(SourceFile:156)
at pl.someclass.fragment.RegistrationFragment$1.onClick(SourceFile:92)

有没有人遇到过类似的问题?

这是我的 proguard-rules.pro 文件:

-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn javax.xml.**
-dontwarn org.apache.**
-dontwarn org.slf4j.**

-keep class com.facebook.** { *; }
-keepattributes Signature

-dontwarn com.google.code.**
-dontwarn oauth.signpost.**
-keep class twitter4j.** { *; }

#javamail
-dontwarn java.awt.**
-dontwarn java.beans.Beans
-dontwarn javax.security.**

-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}

-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}

-dontshrink
-keep class myjava.** {*;}
-keep class org.apache.harmony.** {*;}
-keep public class Mail {*;}


#acra
#ACRA specifics
# Restore some Source file names and restore approximate line numbers in the stack traces,
# otherwise the stack traces are pretty useless
-keepattributes SourceFile,LineNumberTable

# ACRA needs "annotations" so add this...
# Note: This may already be defined in the default "proguard-android-optimize.txt"
# file in the SDK. If it is, then you don't need to duplicate it. See your
# "project.properties" file to get the path to the default "proguard-android-optimize.txt".
-keepattributes *Annotation*

# keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'.
# Note: if you are removing log messages elsewhere in this file then this isn't necessary
-keep class org.acra.ACRA {
*;
}

# keep this around for some enums that ACRA needs
-keep class org.acra.ReportingInteractionMode {
*;
}

-keepnames class org.acra.sender.HttpSender$** {
*;
}

-keepnames class org.acra.ReportField {
*;
}

# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter{
public void addCustomData(java.lang.String,java.lang.String);
public void putCustomData(java.lang.String,java.lang.String);
public void removeCustomData(java.lang.String);
}

# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter{
public void handleSilentException(java.lang.Throwable);
}

最佳答案

通过将以下行添加到您的 proguard-rules.pro 文件,从混淆中排除 Saripaar 类。

-keep class com.mobsandgeeks.saripaar.** {*;}

关于android - Saripaar 由 : java. lang.NoSuchFieldException 引起:LONG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27203689/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com