运行一个安卓程序,出现以下错误原因:
FATAL EXCEPTION: RxIoScheduler-3
Process: com.test.app, PID: 12041
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:59)
at java.util.concurrent.Executors RunnableAdapter.call(Executors.java:422)atjava.util.concurrent.FutureTask.run(FutureTask.java:237)atjava.util.concurrent.ScheduledThreadPoolExecutor R u n n a b l e A d a p t e r . c a l l ( E x e c u t o r s . j a v a : 422 ) a t j a v a . u t i l . c o n c u r r e n t . F u t u r e T a s k . r u n ( F u t u r e T a s k . j a v a : 237 ) a t j a v a . u t i l . c o n c u r r e n t . S c h e d u l e d T h r e a d P o o l E x e c u t o r ScheduledFutureTask.access 201(ScheduledThreadPoolExecutor.java:152)atjava.util.concurrent.ScheduledThreadPoolExecutor 201 ( S c h e d u l e d T h r e a d P o o l E x e c u t o r . j a v a : 152 ) a t j a v a . u t i l . c o n c u r r e n t . S c h e d u l e d T h r e a d P o o l E x e c u t o r ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor Worker.run(ThreadPoolExecutor.java:587)atjava.lang.Thread.run(Thread.java:818)Causedby:java.lang.NoSuchMethodError:NovirtualmethodnewJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader;inclassLcom/google/gson/Gson;oritssuperclasses(declarationof‘com.google.gson.Gson′appearsin/system/framework/android.urovo.device.jar)atretrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:35)atretrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)atretrofit2.ServiceMethod.toResponse(ServiceMethod.java:119)atretrofit2.OkHttpCall.parseResponse(OkHttpCall.java:218)atretrofit2.OkHttpCall.execute(OkHttpCall.java:180)atretrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:40)atretrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:24)atretrofit2.adapter.rxjava.BodyOnSubscribe.call(BodyOnSubscribe.java:36)atretrofit2.adapter.rxjava.BodyOnSubscribe.call(BodyOnSubscribe.java:28)atrx.Observable.unsafeSubscribe(Observable.java:10144)atrx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)atrx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)atrx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)atrx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)atrx.Observable.unsafeSubscribe(Observable.java:10144)atrx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)atrx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)atrx.Observable.unsafeSubscribe(Observable.java:10144)atrx.internal.operators.OperatorMerge W o r k e r . r u n ( T h r e a d P o o l E x e c u t o r . j a v a : 587 ) a t j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 818 ) C a u s e d b y : j a v a . l a n g . N o S u c h M e t h o d E r r o r : N o v i r t u a l m e t h o d n e w J s o n R e a d e r ( L j a v a / i o / R e a d e r ; ) L c o m / g o o g l e / g s o n / s t r e a m / J s o n R e a d e r ; i n c l a s s L c o m / g o o g l e / g s o n / G s o n ; o r i t s s u p e r c l a s s e s ( d e c l a r a t i o n o f ‘ c o m . g o o g l e . g s o n . G s o n ′ a p p e a r s i n / s y s t e m / f r a m e w o r k / a n d r o i d . u r o v o . d e v i c e . j a r ) a t r e t r o f i t 2. c o n v e r t e r . g s o n . G s o n R e s p o n s e B o d y C o n v e r t e r . c o n v e r t ( G s o n R e s p o n s e B o d y C o n v e r t e r . j a v a : 35 ) a t r e t r o f i t 2. c o n v e r t e r . g s o n . G s o n R e s p o n s e B o d y C o n v e r t e r . c o n v e r t ( G s o n R e s p o n s e B o d y C o n v e r t e r . j a v a : 25 ) a t r e t r o f i t 2. S e r v i c e M e t h o d . t o R e s p o n s e ( S e r v i c e M e t h o d . j a v a : 119 ) a t r e t r o f i t 2. O k H t t p C a l l . p a r s e R e s p o n s e ( O k H t t p C a l l . j a v a : 218 ) a t r e t r o f i t 2. O k H t t p C a l l . e x e c u t e ( O k H t t p C a l l . j a v a : 180 ) a t r e t r o f i t 2. a d a p t e r . r x j a v a . C a l l E x e c u t e O n S u b s c r i b e . c a l l ( C a l l E x e c u t e O n S u b s c r i b e . j a v a : 40 ) a t r e t r o f i t 2. a d a p t e r . r x j a v a . C a l l E x e c u t e O n S u b s c r i b e . c a l l ( C a l l E x e c u t e O n S u b s c r i b e . j a v a : 24 ) a t r e t r o f i t 2. a d a p t e r . r x j a v a . B o d y O n S u b s c r i b e . c a l l ( B o d y O n S u b s c r i b e . j a v a : 36 ) a t r e t r o f i t 2. a d a p t e r . r x j a v a . B o d y O n S u b s c r i b e . c a l l ( B o d y O n S u b s c r i b e . j a v a : 28 ) a t r x . O b s e r v a b l e . u n s a f e S u b s c r i b e ( O b s e r v a b l e . j a v a : 10144 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e M a p . c a l l ( O n S u b s c r i b e M a p . j a v a : 48 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e M a p . c a l l ( O n S u b s c r i b e M a p . j a v a : 33 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e L i f t . c a l l ( O n S u b s c r i b e L i f t . j a v a : 48 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e L i f t . c a l l ( O n S u b s c r i b e L i f t . j a v a : 30 ) a t r x . O b s e r v a b l e . u n s a f e S u b s c r i b e ( O b s e r v a b l e . j a v a : 10144 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e M a p . c a l l ( O n S u b s c r i b e M a p . j a v a : 48 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e M a p . c a l l ( O n S u b s c r i b e M a p . j a v a : 33 ) a t r x . O b s e r v a b l e . u n s a f e S u b s c r i b e ( O b s e r v a b l e . j a v a : 10144 ) a t r x . i n t e r n a l . o p e r a t o r s . O p e r a t o r M e r g e MergeSubscriber.onNext(OperatorMerge.java:248)
at rx.internal.operators.OperatorMerge MergeSubscriber.onNext(OperatorMerge.java:148)atrx.internal.operators.OnSubscribeMap M e r g e S u b s c r i b e r . o n N e x t ( O p e r a t o r M e r g e . j a v a : 148 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e M a p MapSubscriber.onNext(OnSubscribeMap.java:77)
at rx.internal.operators.OnSubscribeMap MapSubscriber.onNext(OnSubscribeMap.java:77)atrx.internal.util.ScalarSynchronousObservable M a p S u b s c r i b e r . o n N e x t ( O n S u b s c r i b e M a p . j a v a : 77 ) a t r x . i n t e r n a l . u t i l . S c a l a r S y n c h r o n o u s O b s e r v a b l e WeakSingleProducer.request(ScalarSynchronousObservable.java:276)
at rx.Subscriber.setProducer(Subscriber.java:211)
at rx.internal.operators.OnSubscribeMap MapSubscriber.setProducer(OnSubscribeMap.java:102)atrx.internal.operators.OnSubscribeMap M a p S u b s c r i b e r . s e t P r o d u c e r ( O n S u b s c r i b e M a p . j a v a : 102 ) a t r x . i n t e r n a l . o p e r a t o r s . O n S u b s c r i b e M a p MapSubscriber.setProducer(OnSubscribeMap.java:102)
at rx.internal.util.ScalarSynchronousObservable JustOnSubscribe.call(ScalarSynchronousObservable.java:138)atrx.internal.util.ScalarSynchronousObservable J u s t O n S u b s c r i b e . c a l l ( S c a l a r S y n c h r o n o u s O b s e r v a b l e . j a v a : 138 ) a t r x . i n t e r n a l . u t i l . S c a l a r S y n c h r o n o u s O b s e r v a b l e JustOnSubscribe.call(ScalarSynchronousObservable.java:129)
at rx.Observable.unsafeSubscribe(Observable.java:10144)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
at rx.Observable.unsafeSubscribe(Observable.java:10144)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10144)
at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
at rx.Observable.unsafeSubs
按照网上的解决办法,更新gson依赖包到最新版本2.8.2,但依然没有解决问题。
这个APP是在优博讯的POS机器上运行的,在优博讯另外POS上运行都没有问题。而且这个APP在很多安卓手机上运行都没有问题,偏偏这款POS系统上出现问题。 后找了个优博讯刷机包文件,300多兆,POS上操作系统重新刷机了,问题解决。
2018年3月18日