react-native-track-player icon indicating copy to clipboard operation
react-native-track-player copied to clipboard

APP crashing when device loses internet connection [Android]

Open vbnospace opened this issue 7 years ago • 16 comments

Hi All,

This is happening on a real device, when the device loses internet connect, then recover it crashes the app. fabric.io is showing these logs

MusicModule.java line 102 com.guichaguri.trackplayer.module.MusicModule.waitForConnection

Fatal Exception: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=/com.guichaguri.trackplayer.service.MusicService }: app is in background uid UidRecord{4df9b02 u0a156 CAC bg:+1m6s332ms idle change:cached procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1522) at android.app.ContextImpl.startService(ContextImpl.java:1478) at android.content.ContextWrapper.startService(ContextWrapper.java:650) at android.content.ContextWrapper.startService(ContextWrapper.java:650) at com.guichaguri.trackplayer.module.MusicModule.waitForConnection(MusicModule.java:102) at com.guichaguri.trackplayer.module.MusicModule.stop(MusicModule.java:322) at java.lang.reflect.Method.invoke(Method.java) at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158) at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) at android.os.Looper.loop(Looper.java:164) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232) at java.lang.Thread.run(Thread.java:764)

version: 1.1.4

vbnospace avatar May 02 '19 06:05 vbnospace

@ntk860 Are you saying you've been able to reproduce this?

We have been trying to track down the cause in #473

dustinbahr avatar May 02 '19 14:05 dustinbahr

Oh that would be nice if it is the cause of the crash thanks a lot for that @ntk860 ! @Guichaguri what do you think of it?

ishigamii avatar May 08 '19 19:05 ishigamii

@ntk860 What exactly is the circumstance that causes this for you?

Are you saying:

  • start playing a track
  • disable connection
  • track reaches end of buffer
  • enable connection
  • the error happens?

dustinbahr avatar May 15 '19 22:05 dustinbahr

In the case I described, I just get a playback-error.

dustinbahr avatar May 15 '19 22:05 dustinbahr

@curiousdustin, when I go to a zone where the device loses internet connection, and then I get back to a good zone and the device reestablish the connection it crash the app and throw the exception. I run ads on my app (using react-native-video). It usually happens when the audio from (react-native-audio-player) ends, then a ad comes on (react-native-video), if the device loses connection while the content on (react-native-video) is playing, when the ads end and I try to go to the next track, thats where the app crash.

vbnospace avatar May 22 '19 17:05 vbnospace

I'm getting a similar crash happening only on Android 9. See crash log below: Screen Shot 2019-06-17 at 11 50 06 AM

The0racle avatar Jun 17 '19 18:06 The0racle

@The0racle Same issue. Did you solve this?

Saehanseul avatar Nov 20 '19 02:11 Saehanseul

@Saehanseul no

The0racle avatar Nov 26 '19 22:11 The0racle

I've deployed an app using this library and have around 500 users now, and this crash is my top Crashlytics report right now (about 10-20 reports so far). although upgrading React-Native to 0.60+ reduced number of reports considerably. Unfortunately since my users does not have any significance computer knowledge it's hard to asses why this happens and get a decent scenario from them.

DNA-h avatar Apr 28 '20 11:04 DNA-h

@Guichaguri @curiousdustin I'm also experiencing this crash

ds8k avatar May 15 '20 17:05 ds8k

We are using this with a pretty substantial userbase and this is our most frequent issue by a wide margin.

mfpiccolo avatar May 26 '20 18:05 mfpiccolo

+1

LeonardodeLima avatar Jun 18 '20 13:06 LeonardodeLima

We are using this with a pretty substantial userbase and this is our most frequent issue by a wide margin.

I am quite sure it is not related to loss of internet

DNA-h avatar Jun 30 '20 12:06 DNA-h

I'm getting a similar crash happening only on Android 9. See crash log below: Screen Shot 2019-06-17 at 11 50 06 AM

Same issue here. Is very annoying Screen Shot 2020-07-20 at 5 35 46 PM

ghost avatar Jul 20 '20 21:07 ghost

+1

lonewolfaka9 avatar May 13 '21 11:05 lonewolfaka9

+1

mattiaefesto avatar Oct 04 '21 13:10 mattiaefesto