Foreground Service Crash: `RemoteServiceException$ForegroundServiceDidNotStartInTimeException` During Instant Upload Sync
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
Trying to sync instant upload
### Expected behaviour
Sync files
### Actual behaviour
App crashes with link to Git Hub
### Android version
30330090
### Device brand and model
Galaxy Z-Fold 6
### Stock or custom OS?
Stock
### Nextcloud android app version
30330090
### Nextcloud server version
31.0.9
### Using a reverse proxy?
No
### Android logs
### Cause of error
```java
Exception in thread "main" android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{371abee u0 com.nextcloud.client/androidx.work.impl.foreground.SystemForegroundService c:com.nextcloud.client}
at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2495)
at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2463)
at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2816)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:257)
at android.os.Looper.loop(Looper.java:342)
at android.app.ActivityThread.main(ActivityThread.java:9634)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:619)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
```
### App information
* ID: `com.nextcloud.client`
* Version: `30330090`
* Build flavor: `gplay`
### Device information
* Brand: `samsung`
* Device: `q6q`
* Model: `SM-F956U1`
* Id: `AP3A.240905.015.A2`
* Product: `q6quew`
### Firmware
* SDK: `35`
* Release: `15`
* Incremental: `F956U1UES2BYGB`
### Server error logs
```bash
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.