You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2020-09-08 07:20:21.303 com.nextcloud.client E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nextcloud.client, PID: 10750
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{a08f83f u0 com.nextcloud.client/.media.PlayerService}
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1945)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
@ezaquarii this happens on latest dev, and it seems that it is from your foreground fix:
Upon file removed event, FileDisplayActivity onRemoveFileOperationFinish is called and this calls tryStopPlaying.
Similar to startService(Intent), but with an implicit promise that the Service will call startForeground(int, android.app.Notification) once it begins running.
And this is not true if we only try to stop playback as then directly onStop() is called in PlayerService.
As startForeground is showing a notification, I do not want to show it, and then immediately stop player.
I need to think a bit more about the possible fix. On newer API levels, interacting with services in the background is limited by the OS. Quite a lot of our code assumes that you can ping a background service at will.
I need to take a closer look at the player state machine.
I know that the previous PR #6798 addressed a similar issue in different code path, however we can consider what is the lesser evil here - keeping the fix or backing it out - by comparing the severity of those 2 bugs. I have no access to crash logs, but feel free to back out #6798 if you feel that previous bug was less serious.
Fehlerlog:
`********** CAUSE OF ERROR **********
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{415238b u0 com.nextcloud.client/.media.PlayerService}
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Activity
tobiasKaminsky commentedon Sep 8, 2020
Doc from context.startForegroundService(i) says:
And this is not true if we only try to stop playback as then directly onStop() is called in PlayerService.
As startForeground is showing a notification, I do not want to show it, and then immediately stop player.
ezaquarii commentedon Sep 8, 2020
I'll look into this.
test for #6905
tobiasKaminsky commentedon Sep 8, 2020
#6908 I wrote a (failing) test for this.
ezaquarii commentedon Sep 9, 2020
@tobiasKaminsky this will be very handy.
ezaquarii commentedon Sep 11, 2020
@tobiasKaminsky
I need to think a bit more about the possible fix. On newer API levels, interacting with services in the background is limited by the OS. Quite a lot of our code assumes that you can ping a background service at will.
I need to take a closer look at the player state machine.
I know that the previous PR #6798 addressed a similar issue in different code path, however we can consider what is the lesser evil here - keeping the fix or backing it out - by comparing the severity of those 2 bugs. I have no access to crash logs, but feel free to back out #6798 if you feel that previous bug was less serious.
AndyScherzinger commentedon Nov 3, 2020
Also see #7189 (comment)
AndyScherzinger commentedon Nov 3, 2020
Also see #7187 (comment)
AndyScherzinger commentedon Nov 3, 2020
Also see #7191 (comment)
XueSheng-GIT commentedon Nov 11, 2020
Still can't play videos in 3.14.0 RC2 without crash. Will this be fixed for 3.14.0 final?
Siggi0904 commentedon Nov 14, 2020
Still crashes with RC2.
tobiasKaminsky commentedon Nov 17, 2020
There is an APK file in PR #7340, which you can install in parallel to your existing Nextcloud app.
It would be great if you can verify the fix.
Siggi0904 commentedon Nov 19, 2020
Auch mit der 3.14.0 stable crasht die App.
Fehlerlog:
`********** CAUSE OF ERROR **********
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{415238b u0 com.nextcloud.client/.media.PlayerService}
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
********** APP INFORMATION **********
ID: com.nextcloud.client
Version: 30140090
Build flavor: gplay
********** DEVICE INFORMATION **********
Brand: OnePlus
Device: OnePlus6
Model: ONEPLUS A6003
Id: QKQ1.190716.003
Product: OnePlus6
********** FIRMWARE **********
SDK: 29
Release: 10
Incremental: 2010042216`
tobiasKaminsky commentedon Nov 20, 2020
Will be fixed with #7340
test for #6905
Siggi0904 commentedon Nov 24, 2020
Error still exists.
See: #7470
tobiasKaminsky commentedon Nov 25, 2020
This should be fixed in 3.14.1 RC2 coming today. You can test it via play store beta program.
If not, please re-open.