You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
堆栈/日志:
java.lang.ClassCastException: tinker.sample.android.app.MyApplication cannot be cast to tinker.sample.android.app.MyApplication
at tinker.sample.android.app.MainActivity$6.onClick(MainActivity.java:114)
at android.view.View.performClick(View.java:5646)
at android.view.View$PerformClick.run(View.java:22450)
at android.os.Handler.handleCallback(Handler.java:755)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
异常类型:ClassCastException
手机型号:华为Mate8
手机系统版本:7.0
tinker版本:如:1.7.7
gradle版本:如:2.2.3
是否使用热更新SDK: 否
系统:Windows
堆栈/日志:
java.lang.ClassCastException: tinker.sample.android.app.MyApplication cannot be cast to tinker.sample.android.app.MyApplication
at tinker.sample.android.app.MainActivity$6.onClick(MainActivity.java:114)
at android.view.View.performClick(View.java:5646)
at android.view.View$PerformClick.run(View.java:22450)
at android.os.Handler.handleCallback(Handler.java:755)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
报错的代码片段:
((MyApplication) getApplication()).setToken("set data");
MyApplication是自定义的仿官方实体类:
public class MyApplication extends TinkerApplication {
}
经多次测试,这个异常暂只出现7.0系统上。
查询wiki,说是不应该再使用这个application实例。但是当前程序已经有很多地方使用了这种通过application实例进行set、get方式的代码,全部调换的话太不方便。
请问有方法解决这个问题么?
The text was updated successfully, but these errors were encountered: