Issue type
Feature not working as intended
Device
Xiaomi POCO F2 Pro (lmi)
crDroid version
crDroid 12
Exact version / Build date
12.10 / 2026-05-25
Bug description
When enabling “Always-on VPN” for sing-box, the VPN service may fail to start correctly after reboot or automatic system startup. The app can crash with ForegroundServiceDidNotStartInTimeException.
Manual VPN startup works normally. The issue only occurs when Always-on VPN is enabled.
Steps to reproduce
Step 1. Install sing-box VPN client.
Step 2. Go to Settings → Network & Internet → VPN.
Step 3. Enable “Always-on VPN” for sing-box.
Step 4. Reboot the device or allow the system to auto-start the VPN service.
Step 5. Observe VPN startup behavior.
Relevant log (logcat/build log)
time: 1778003195635
msg: android.app.StackTrace: Last startServiceCommon() call for this service was made here
stacktrace: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{47e88ce u0 io.nekohasekai.sfa/.bg.VPNService c:android}
at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2530)
at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2498)
at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2882)
at android.os.Handler.dispatchMessage(Handler.java:132)
at android.os.Looper.dispatchMessage(Looper.java:333)
at android.os.Looper.loopOnce(Looper.java:263)
at android.os.Looper.loop(Looper.java:367)
at android.app.ActivityThread.main(ActivityThread.java:9317)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:2115)
at android.app.ContextImpl.startForegroundService(ContextImpl.java:2069)
at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:875)
at e6.o.l(r8-map-id-c1c055f3283a5e997acc60fc44bae16a579dfbaedc816d08271cd56a5c2d7be6:1)
at io.nekohasekai.sfa.bg.BoxService$Companion.start(r8-map-id-c1c055f3283a5e997acc60fc44bae16a579dfbaedc816d08271cd56a5c2d7be6:27)
at io.nekohasekai.sfa.bg.BootReceiver$onReceive$1$1.invokeSuspend(r8-map-id-c1c055f3283a5e997acc60fc44bae16a579dfbaedc816d08271cd56a5c2d7be6:10)
at tf.a.resumeWith(r8-map-id-c1c055f3283a5e997acc60fc44bae16a579dfbaedc816d08271cd56a5c2d7be6:9)
at og.j0.run(r8-map-id-c1c055f3283a5e997acc60fc44bae16a579dfbaedc816d08271cd56a5c2d7be6:114)
at android.os.Handler.handleCallback(Handler.java:1070)
at android.os.Handler.dispatchMessage(Handler.java:125)
... 7 more
Screenshots or videos
No response
Solution
No confirmed solution yet.
Additional context
The issue was originally observed on crDroid 12.9 and is still reproducible on crDroid 12.10 / 2026-05-25.
The system appears to start the VPN service through the Always-on VPN mechanism, but the service may not enter foreground state in time and gets terminated.
Current status:
- Manual VPN start: working
- Always-on VPN: unstable
- Auto-start after reboot: may fail
I have also reported the same issue upstream in sing-box:
[SagerNet/sing-box Issue #4114]
The problem only occurs when the VPN service is automatically started through the Always-on VPN mechanism after boot.
This may be related to:
- Android 16 foreground service timing restrictions
- sing-box service initialization timing
- or ROM-specific background service handling
Acknowledgements
Issue type
Feature not working as intended
Device
Xiaomi POCO F2 Pro (lmi)
crDroid version
crDroid 12
Exact version / Build date
12.10 / 2026-05-25
Bug description
When enabling “Always-on VPN” for sing-box, the VPN service may fail to start correctly after reboot or automatic system startup. The app can crash with ForegroundServiceDidNotStartInTimeException.
Manual VPN startup works normally. The issue only occurs when Always-on VPN is enabled.
Steps to reproduce
Step 1. Install sing-box VPN client.
Step 2. Go to Settings → Network & Internet → VPN.
Step 3. Enable “Always-on VPN” for sing-box.
Step 4. Reboot the device or allow the system to auto-start the VPN service.
Step 5. Observe VPN startup behavior.
Relevant log (logcat/build log)
Screenshots or videos
No response
Solution
No confirmed solution yet.
Additional context
The issue was originally observed on crDroid 12.9 and is still reproducible on crDroid 12.10 / 2026-05-25.
The system appears to start the VPN service through the Always-on VPN mechanism, but the service may not enter foreground state in time and gets terminated.
Current status:
I have also reported the same issue upstream in sing-box:
[SagerNet/sing-box Issue #4114]
The problem only occurs when the VPN service is automatically started through the Always-on VPN mechanism after boot.
This may be related to:
Acknowledgements