编程语言
首页 > 编程语言> > 致命异常:java.lang.IncompatibleClassChangeError:找不到com.google.a.a.c.a

致命异常:java.lang.IncompatibleClassChangeError:找不到com.google.a.a.c.a

作者:互联网

我在带有操作系统5.0.1的三星设备的CrashListics中反复遇到此异常,我在SO中进行了很多搜索,发现这是三星设备中的错误,但找不到任何解决方案.谁能建议我如何处理此异常(任何解决方案或任何技巧)?

Fatal Exception: java.lang.IncompatibleClassChangeError: Couldn’t find
com.google.a.a.c.a
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:659)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170)
at java.lang.reflect.Field.getAnnotation(Field.java:242)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.excludeField(Unknown
Source)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.excludeField(Unknown
Source)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.excludeField(Unknown
Source)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.excludeField(Unknown
Source)
at com.google.gson.Gson.doubleAdapter(Unknown Source)
at com.google.gson.Gson.doubleAdapter(Unknown Source)
at com.google.gson.Gson.doubleAdapter(Unknown Source)
at com.google.gson.Gson.doubleAdapter(Unknown Source)
at com.google.gson.Gson.doubleAdapter(Unknown Source)
at com.app.Data.Sessions.LoginSession.createLoginSession(Unknown
Source)

at com.app.Data.UserInformation.getInfo(Unknown
Source)
at com.app.Main.LocationUpdateService.locationUpdate(Unknown
Source)
at com.app.Main.LocationUpdateService.locationUpdate(Unknown
Source)
at com.app.Main.LocationUpdateService$1.onLocationChanged(Unknown
Source)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:281)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:210)
at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:226)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

在createLoginSession中,我正在做的是:

public void createLoginSession(UserData userData) {
    Gson gson = new Gson();
    String info = gson.toJson(userData);
    editor.putString(INFO, info);
    editor.commit();
}

解决方法:

您需要保留模型UserData,请不要混淆.像这样:

-keep class yourpackage.model.** {*; }

并保持你的儿子

-keep com.google.gson.stream.** {*; }

标签:fatal-error,exception,exception-handling,java,android
来源: https://codeday.me/bug/20191111/2021952.html