Skip to content

App crashes when opening *Nearby* in a particular scenario #1504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sivaraam opened this issue May 9, 2018 · 16 comments
Closed

App crashes when opening *Nearby* in a particular scenario #1504

sivaraam opened this issue May 9, 2018 · 16 comments

Comments

@sivaraam
Copy link
Member

sivaraam commented May 9, 2018

Summary:
Nearby crashes when the phone is connected to a network that is disconnected from the ISP's network. To be more detailed, I use a Wi-Fi enabled data modem with the ability to disconnect the data service. So, when I disconnect the data service and connect the phone to the Wi-Fi network (which isn't connected to the ISP's network) and visit Nearby, the app crashes.

Steps to reproduce:

  1. Connect to a network that isn't connected to the ISP's network in some way (one way is described in the summary)
  2. Open the app
  3. Open Nearby

Add System logs:

D/NearbyPlaces: java.net.ConnectException: failed to connect to query.wikidata.org/192.168.206.84 (port 443): connect failed: ECONNREFUSED (Connection refused)
D/NearbyPlaces: back to initial radius: 1.000000
W/System.err: io.reactivex.exceptions.OnErrorNotImplementedException: Callable returned null
W/System.err:     at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
W/System.err:     at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
W/System.err:     at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:74)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:276)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
W/System.err:     at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err:     at android.os.Looper.loop(Looper.java:145)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6946)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
W/System.err: Caused by: java.lang.NullPointerException: Callable returned null
W/System.err:     at io.reactivex.internal.functions.ObjectHelper.requireNonNull(ObjectHelper.java:39)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableFromCallable.subscribeActual(ObservableFromCallable.java:42)
W/System.err:     at io.reactivex.Observable.subscribe(Observable.java:10901)
W/System.err:     at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err:     at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
W/System.err:     at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
W/System.err:     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err:     at java.lang.Thread.run(Thread.java:818)
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: fr.free.nrw.commons.debug, PID: 16239
                  io.reactivex.exceptions.OnErrorNotImplementedException: Callable returned null
...
I/Process: Sending signal. PID: 16239 SIG: 9

Expected behavior:
Warn about the inability to connect to the network.

Observed behavior:
The app crashes.

Device and Android version:
Device: Samsung Galaxy J2
Android: 5.1.1

Commons app version:
2.7.1

Would you like to work on the issue?
Nope, sorry ☺️

@misaochan
Copy link
Member

Is it Android Studio that isn't working for you, or manual builds? AFAIK you can get logs via Android Studio's logcat without building - if you download the Play Store version and hook it up to your computer, it should still display logs (although filtering them might work differently).

We have a "Send logs" feature, but that really needs to be fixed as it hasn't given us anything useful ever. :/ There is a separate issue for that.

@sivaraam
Copy link
Member Author

sivaraam commented May 9, 2018

Is it Android Studio that isn't working for you, or manual builds? ? AFAIK you can get logs via Android Studio's logcat without building ...

Actually Android studio required the Gradle build for the modified source (not the apk generation) to be completed before the dubug console could be used to debug the hooked up to the device.

@ashishkumar468
Copy link
Collaborator

ashishkumar468 commented May 10, 2018

I tried to reproduce the issue and made the app crash with the following logs

io.reactivex.exceptions.OnErrorNotImplementedException: Callable returned null
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
        at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:74)
        at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:276)
        at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172)
        at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
        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:5254)
        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:903)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
     Caused by: java.lang.NullPointerException: Callable returned null
        at io.reactivex.internal.functions.ObjectHelper.requireNonNull(ObjectHelper.java:39)
        at io.reactivex.internal.operators.observable.ObservableFromCallable.subscribeActual(ObservableFromCallable.java:42)
        at io.reactivex.Observable.subscribe(Observable.java:10901)
        at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:452)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
        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)

@maskaravivek
Copy link
Member

Looks like null isn't handled properly while loading data in nearby. @ashishkumar468 will you be able to take care of this issue?

@ashishkumar468
Copy link
Collaborator

@maskaravivek I have most probably made the fix, creating a pull request for the same

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue May 10, 2018
@sivaraam
Copy link
Member Author

Thanks @ashishkumar468 for your thoughts.

Actually Android studio required the Gradle build for the modified source (not the apk generation) to be completed before the dubug console could be used to debug the hooked up to the device.

Sorry, that seems to be a misleading comment. I actually was overlooked and mistook the "debug build" icon for the "attach debugger" icon 😞

Regardless, I wasn't able to able to attach the debugger to a production release.

@sivaraam

This comment has been minimized.

@ashishkumar468

This comment has been minimized.

@sivaraam

This comment has been minimized.

@ashishkumar468

This comment has been minimized.

@sivaraam

This comment has been minimized.

@ashishkumar468
Copy link
Collaborator

@sivaraam Sure, Thanks for the suggestion, you can create a new issue for that and someone can pick that up as an enhancement, coming back to this issue, were you able to login ?

@sivaraam
Copy link
Member Author

Yeah, I was able to log-in and the app seems to crash as noticed before. And the log output seems to be the same as the one you posted in your comment.

@ashishkumar468
Copy link
Collaborator

@sivaraam The changes have not yet been merged to master, you will have to take a take a pull from branch ashishkumar468:feature/bug_fix_#1504 to verify

ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue May 10, 2018
ashishkumar468 added a commit to ashishkumar468/apps-android-commons that referenced this issue May 11, 2018
@sivaraam

This comment has been minimized.

@maskaravivek
Copy link
Member

@sivaraam Please refrain from posting about other issues on a thread that is totally unrelated. It adds to the confusion. :)

maskaravivek pushed a commit that referenced this issue May 18, 2018
* Bug fix #1504

* Filtered messages with ConnectException [issue #1504]

* A generalised message for exceptions in Nearby Activity [issue #1504]
misaochan pushed a commit that referenced this issue May 31, 2018
…rby (#1495)

* Localisation updates from https://translatewiki.net.

* Integrate API for displaying featured images (#1456)

* Integrate API for displaying featured images

* Add pagination and refactor code so that it can be reused for category images

* Add license info to the images

* Fix author view

* Remove unused values

* Fix minor issues with featured images

* Fix null license url issue

* Remove some log lines

* Fix back navigation issue

* fix tests

* fix test inits

* Gracefully handling various error situations

* Added java docs

* Update pull_request_template.md (#1476)

* Update pull_request_template.md

* Remove Javadocs mention

* Added required/optional notes

* resolves #1464 : MediaDataExtractor is making inefficient (redundant) server calls (#1496)

* Open map of place where picture was taken (#1360)

* Intent to map added

*  Merge conflicts resolved

*  Added the functionality to hide FAB incase of null coordinate

*  Merge Conflict resolved

*  Improve pr quality

* Improve Quality

*  Added nested FAB animations

* Nested FAB implemented

*  Improve Quality

*  Added up arrow

*  Javadocs Added

* Add nearby tutorial (#1467)

* Add dependency for MaterialShowcase

* Add actionview class to get a reference to material showcase

* Create a NearbyMaterialShowcaseSequence class

* Apply sequence steps

* Add first three steps of nearby showcase

* Add sequence id constants to make sure they will be displayed only once

* Add last step of sequence to explain plus fab

* Create an object to prevent customize all sequences every time

* Fix typo

* Code cleanup

* Add strings to strings.xml

* Code cleanup

* Revert irrelevant change

* Revert irrelevant change

* Remove showcaseview for recenter button

* Use single showcaseView instead of sequence

* Add single showcase view insted of sequence to be able to edit text style

* Make sure it will be displayed only once

* Cleanup

* Update strings

* Change dismiss text style

* CONTRIBUTING: fix formatting of the gist of the guidelines (#1453)

* CONTRIBUTING: fix formatting of the gist of the guidelines

First level headings for a gist seems to be overkill.

So, replace first level headings with an ordered-list which
sounds more meaningful.

* CONTRIBUTING: specify clearly that 'blame' is a feature of "Git"

The contributing file specifies about the ability to know who wrote
something without the need of @author javadoc tags but incorrectly
attributes the feature to GitHub.

Correctly attribute the feature to where it belongs, Git, and specify
the name of the feature to help users easily take advantage of it.

* Feature/switch to butterknife (#1494)

* Implemented butterknife in MediaDetailFragment [issue #1491]

* Implemented butterknife in MediaDetailPagerFragment [[issue #1491]]

* post merge upstream master wip [[issue #1491]]

* Localisation updates from https://translatewiki.net.

* Bug fix #1504 (#1506)

* Bug fix #1504

* Filtered messages with ConnectException [issue #1504]

* A generalised message for exceptions in Nearby Activity [issue #1504]

* Localisation updates from https://translatewiki.net.

* Fix security exception crash while accessing network location provider (#1498)

* Fix security exception crash while accessing network location provider

* Added java docs

* Localisation updates from https://translatewiki.net.

* Log P18 edits to wikidata corresponding wikidata entity on uploading a nearby image

* Added java docs

* Fix test build

* Refresh nearby

* Refresh nearby list on successful edit

* Java docs

* Make authenticated wikidata edits

* Updated toast message to show entity name that was edited
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants