patloew/RxLocation

Crash on fromLocation call

Jawnnypoo opened this issue · 1 comments

You can reproduce this very easily by starting the sample app on a device with no internet connection. Here's the stack trace:

03-14 16:30:27.556 22738-22738/com.patloew.rxfitsample E/MainPresenter: Error fetching location/address updates
                                                                        java.io.IOException: Timed out waiting for response from server
                                                                            at android.location.Geocoder.getFromLocation(Geocoder.java:136)
                                                                            at com.patloew.rxlocation.Geocoding.lambda$fromLocation$1(Geocoding.java:62)
                                                                            at com.patloew.rxlocation.Geocoding$$Lambda$1.call(Unknown Source)
                                                                            at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
                                                                            at io.reactivex.Single.subscribe(Single.java:2693)
                                                                            at io.reactivex.internal.operators.single.SingleFlatMapMaybe.subscribeActual(SingleFlatMapMaybe.java:41)
                                                                            at io.reactivex.Maybe.subscribe(Maybe.java:3707)
                                                                            at io.reactivex.internal.operators.maybe.MaybeToObservable.subscribeActual(MaybeToObservable.java:43)
                                                                            at io.reactivex.Observable.subscribe(Observable.java:10700)
                                                                            at io.reactivex.internal.operators.observable.ObservableSubscribeOn$1.run(ObservableSubscribeOn.java:39)
                                                                            at io.reactivex.Scheduler$1.run(Scheduler.java:138)
                                                                            at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:59)
                                                                            at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:51)
                                                                            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
                                                                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
                                                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                            at java.lang.Thread.run(Thread.java:818)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err: io.reactivex.exceptions.UndeliverableException: java.io.IOException: Timed out waiting for response from server
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:366)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.observers.DeferredScalarDisposable.error(DeferredScalarDisposable.java:95)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.maybe.MaybeToObservable$MaybeToFlowableSubscriber.onError(MaybeToObservable.java:73)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.single.SingleFlatMapMaybe$FlatMapSingleObserver.onError(SingleFlatMapMaybe.java:95)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:43)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.Single.subscribe(Single.java:2693)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.single.SingleFlatMapMaybe.subscribeActual(SingleFlatMapMaybe.java:41)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.Maybe.subscribe(Maybe.java:3707)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.maybe.MaybeToObservable.subscribeActual(MaybeToObservable.java:43)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.Observable.subscribe(Observable.java:10700)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.observable.ObservableSubscribeOn$1.run(ObservableSubscribeOn.java:39)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.Scheduler$1.run(Scheduler.java:138)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:59)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:51)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at java.lang.Thread.run(Thread.java:818)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err: Caused by: java.io.IOException: Timed out waiting for response from server
03-14 16:30:31.606 22738-22981/com.patloew.rxfitsample E/AndroidRuntime: FATAL EXCEPTION: RxCachedThreadScheduler-2
                                                                         Process: com.patloew.rxfitsample, PID: 22738
                                                                         io.reactivex.exceptions.UndeliverableException: java.io.IOException: Timed out waiting for response from server
                                                                             at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:366)
                                                                             at io.reactivex.internal.observers.DeferredScalarDisposable.error(DeferredScalarDisposable.java:95)
                                                                             at io.reactivex.internal.operators.maybe.MaybeToObservable$MaybeToFlowableSubscriber.onError(MaybeToObservable.java:73)
                                                                             at io.reactivex.internal.operators.single.SingleFlatMapMaybe$FlatMapSingleObserver.onError(SingleFlatMapMaybe.java:95)
                                                                             at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:43)
                                                                             at io.reactivex.Single.subscribe(Single.java:2693)
                                                                             at io.reactivex.internal.operators.single.SingleFlatMapMaybe.subscribeActual(SingleFlatMapMaybe.java:41)
                                                                             at io.reactivex.Maybe.subscribe(Maybe.java:3707)
                                                                             at io.reactivex.internal.operators.maybe.MaybeToObservable.subscribeActual(MaybeToObservable.java:43)
                                                                             at io.reactivex.Observable.subscribe(Observable.java:10700)
                                                                             at io.reactivex.internal.operators.observable.ObservableSubscribeOn$1.run(ObservableSubscribeOn.java:39)
                                                                             at io.reactivex.Scheduler$1.run(Scheduler.java:138)
                                                                             at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:59)
                                                                             at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:51)
                                                                             at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
                                                                             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
                                                                             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                             at java.lang.Thread.run(Thread.java:818)
                                                                          Caused by: java.io.IOException: Timed out waiting for response from server
                                                                             at android.location.Geocoder.getFromLocation(Geocoder.java:136)
                                                                             at com.patloew.rxlocation.Geocoding.lambda$fromLocation$1(Geocoding.java:62)
                                                                             at com.patloew.rxlocation.Geocoding$$Lambda$1.call(Unknown Source)
                                                                             at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
                                                                             at io.reactivex.Single.subscribe(Single.java:2693) 
                                                                             at io.reactivex.internal.operators.single.SingleFlatMapMaybe.subscribeActual(SingleFlatMapMaybe.java:41) 
                                                                             at io.reactivex.Maybe.subscribe(Maybe.java:3707) 
                                                                             at io.reactivex.internal.operators.maybe.MaybeToObservable.subscribeActual(MaybeToObservable.java:43) 
                                                                             at io.reactivex.Observable.subscribe(Observable.java:10700) 
                                                                             at io.reactivex.internal.operators.observable.ObservableSubscribeOn$1.run(ObservableSubscribeOn.java:39) 
                                                                             at io.reactivex.Scheduler$1.run(Scheduler.java:138) 
                                                                             at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:59) 
                                                                             at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:51) 
                                                                             at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                                                                             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 
                                                                             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 
                                                                             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                             at java.lang.Thread.run(Thread.java:818) 
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at android.location.Geocoder.getFromLocation(Geocoder.java:136)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at com.patloew.rxlocation.Geocoding.lambda$fromLocation$1(Geocoding.java:62)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at com.patloew.rxlocation.Geocoding$$Lambda$1.call(Unknown Source)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err:     at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:35)
03-14 16:30:31.596 22738-22981/com.patloew.rxfitsample W/System.err: 	... 15 more

It is especially strange because it looks like the presenter is catching that initial thrown error, and it will be just fine, but then a few seconds later, the crash occurs as an UndeliverableException, which you can read more about here

Please see #13 and #16.