Vydia / react-native-background-upload

Upload files in your React Native app even while it's backgrounded. Supports Android and iOS, including camera roll assets.
MIT License
726 stars 332 forks source link

Possible crash RN 0.59.10 #154

Open nonotest opened 5 years ago

nonotest commented 5 years ago

Hi guys,

just saw this crash report - wondering if anyone has experienced this / any idea on how to solve..

android.app.RemoteServiceException · Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{bf14da4 u0 .../net.gotev.uploadservice.UploadService}
ActivityThread.java:1872android.app.ActivityThread$H.handleMessage  
Handler.java:106android.os.Handler.dispatchMessage  
Looper.java:214android.os.Looper.loop   
ActivityThread.java:7045android.app.ActivityThread.main 
Method.java:-2java.lang.reflect.Method.invoke   
RuntimeInit.java:493com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run 
ZygoteInit.java:965com.android.internal.os.ZygoteInit.main

Device: Samsung SM-G955F with Android 9

can provide more details if needed.

karanpratapsingh commented 5 years ago

did you find a solution? I also have a similar issue on android 9

peacepostman commented 5 years ago

Hello guys, not sure if it is related but i think we successfully avoid this error by adding new permission in android :

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

karanpratapsingh commented 5 years ago

@peacepostman Thanks a lot, I also just figured this out 20 mins ago, AWESOME

quarryman commented 5 years ago

Hi Can you guys tell what app behavior do you see once you face this kind of crush? Is app closed?

quarryman commented 5 years ago

UPD: Before I implemented this I had upload forcing my app to go to background mode in favour of upload service popup and app crush soon.

vmary2014 commented 5 years ago

@quarryman I came across this issue too, the solution provided by @peacepostman worked for me as well. Essentially the app crashes but there are notifications of the service trying to upload the pictures without progressing. My device is on Android 9 - P20 Huawei phone. Hope this helps and thanks @peacepostman for the solution.

chasms commented 5 years ago

Duplicated here: https://github.com/Vydia/react-native-background-upload/issues/159

quarryman commented 5 years ago

@vmary2014 If your app stop receiving events from uploader, this might be another known issue https://github.com/Vydia/react-native-background-upload/issues/129 There is fork proposed, that solved it for me

xOIBrandon commented 3 years ago

I'm seeing this same error and I do have the FOREGROUND_SERVICE permission set. Does anyone here have any other suggestions? I'm at a loss

Android: v1.1.10 React Native: v0.62.2 React Native Background Upload: v5.1.0

android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{1254bf5 u0 io.xoi.vision/net.gotev.uploadservice.UploadService}
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2240)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:246)
    at android.app.ActivityThread.main(ActivityThread.java:8506)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
xOIBrandon commented 3 years ago

Hey y'all. I tracked this bug down to android-background-upload. The maintainer of that library released a new version that we hope will solve this problem. android-background-upload: 4.5.3