Open-event-droidgen: App crashing

Created on 26 Sep 2016  路  13Comments  路  Source: fossasia/open-event-droidgen

Found a crash.
Steps which i performed -

  1. Launched the app
  2. Selected a track
  3. Opened a session detail
  4. Bookmark the session
  5. Press back twice to reach the first activity
  6. Now do swipe refresh. As soon as the refresh gets finished, app crashes.

Many times app did not crashed by performing the above steps. So there may be few other things which is causing the crash. Below is the crash log -

09-26 18:07:00.236 19148-19148/org.fossasia.openevent E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.fossasia.openevent, PID: 19148
java.lang.RuntimeException: Could not dispatch event: class org.fossasia.openevent.events.TracksDownloadEvent to handler [EventHandler public void org.fossasia.openevent.fragments.TracksFragment.onTrackDownloadDone(org.fossasia.openevent.events.TracksDownloadEvent)]: Attempt to invoke virtual method 'void android.support.v4.widget.SwipeRefreshLayout.setRefreshing(boolean)' on a null object reference
at com.squareup.otto.Bus.throwRuntimeException(Bus.java:460)
at com.squareup.otto.Bus.dispatch(Bus.java:387)
at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:368)
at com.squareup.otto.Bus.post(Bus.java:337)
at org.fossasia.openevent.OpenEventApp$1.run(OpenEventApp.java:58)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.SwipeRefreshLayout.setRefreshing(boolean)' on a null object reference
at org.fossasia.openevent.fragments.TracksFragment.onTrackDownloadDone(TracksFragment.java:183)
at java.lang.reflect.Method.invoke(Native Method)
at com.squareup.otto.EventHandler.handleEvent(EventHandler.java:89)
at com.squareup.otto.Bus.dispatch(Bus.java:385)
at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:368)聽
at com.squareup.otto.Bus.post(Bus.java:337)聽
at org.fossasia.openevent.OpenEventApp$1.run(OpenEventApp.java:58)聽
at android.os.Handler.handleCallback(Handler.java:746)聽
at android.os.Handler.dispatchMessage(Handler.java:95)聽
at android.os.Looper.loop(Looper.java:148)聽
at android.app.ActivityThread.main(ActivityThread.java:5443)聽
at java.lang.reflect.Method.invoke(Native Method)聽
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)聽
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)聽

Will try to fix it.

hacktoberfest

All 13 comments

App crash even if session is not bookmarked.

@passiondroid are you working on this?
@the-dagger I would like to work on this.

@amitiwary999 You can continue to fix it.

@jig08 I think there is a problem with circleci. My previous pr #732 is pending.can you review it so that I can start work on this issue.

@amitiwary999 @passiondroid #732 pr fix it only work around.
it's easy to reproduce.

  1. click track.
  2. click speaker
  3. click track. ====> crash.
    it's also happen with speaker, track, sponsors and location page when user revisit them.
    Because OnDestroyView it unbind all view, but this instance still keep as handler event.
    So when swipe refresh, download data and call back handler event, Null pointer exception appear.
    We need to unRegister event in onDestroyView too.
    I will create pull request now.
    Please help me check it.

@dhluong90 Sir are you taking about issue #720 or this issue(i.e #715)?

Look #720 and #715 are the same.

App crash when we revisit any page:
track, speaker, sponsors, location. you can try it.

Yeah tried it.

@dhluong90 So are you sending a new PR or I open a new PR?

I sent it. Please help me review it. Thank @amitiwary999
https://github.com/fossasia/open-event-android/pull/733

@dhluong90 please inform before sending PR.
Ok I saw it.but from now onward if you want to work on an issue inform the assigne first.Because I already started working on it.

@the-dagger @jig08 this issue is solved so close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dreadpool2 picture dreadpool2  路  7Comments

mahikaw picture mahikaw  路  8Comments

iamareebjamal picture iamareebjamal  路  7Comments

mariobehling picture mariobehling  路  6Comments

shreyasnbhat picture shreyasnbhat  路  8Comments