microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.35k stars 1.71k forks source link

Every app freezing, possibly due to "StrictMode policy violation: android.os.strictmode.NetworkViolation" #2405

Open dimaryaz opened 3 months ago

dimaryaz commented 3 months ago

Describe the bug I'm using LineageOS for MicroG. Since the lineage-21.0-20240508-microG-instantnoodle update, I've been having problems with every possible app - including SystemUI - freezing for multiple seconds and triggering the "[app] not responding" dialog box (which also never goes away, forcing me to kill the app, but that's a separate bug). I can't say for certain that it's MicroG's fault; I also have Magisk installed. When I updated to lineage-21.0-20240608, it got slightly better, but still bad.

adb logcat shows stack traces for NetworkViolation caused by org.microg.gms.auth.AuthManagerServiceImpl.onTransact - so that's why I suspect it may be caused by MicroG.

To Reproduce It happens randomly; everything can work fine for hours, even days - then start freezing constantly for several hours. I suspected it had to do with bad network quality; it seems correlated, but not completely.

Expected behavior Apps shouldn't freeze.

Screenshots

System Android Version: 14 Custom ROM: LineageOS for MicroG 21, 20240608

Additional context Output from adb logcat showing the NetworkViolation:

adb.log

dimaryaz commented 3 months ago

Just guessing here, but is it possible that org.microg.gms.auth.AuthManagerServiceImpl.onTransact is not supposed to do blocking network calls? E.g., can it be called by apps' UI thread, etc.?

dimaryaz commented 2 months ago

Update: I had two disabled Google accounts that were trying to sync and failing. When I turned off syncing for them, the freezing has pretty much gone away. So that does seem to imply that it was caused by MicroG.

Though I still don't understand how Google accounts sync can affect things like SystemUI.

Axolord commented 2 months ago

I actually have the same problem. Started aplearing about two months ago.

Device: FP4 OS: CalyxOS 5.9.0 Android: 14 microG 0.3.2.240913-19 (calyxos build)

Though I dont have sync enabled for my google account and no deactivated accounts either. How did you exactly fix your problem?

dimaryaz commented 2 months ago

@Axolord: Hmm, if you don't have sync enabled, then I'm guessing this won't help you... I had one working Gmail account, and two Google Apps accounts that were deleted (on the server-side). I completely removed one of the Google Apps accounts from Android settings; I decided to leave the other account as an experiment, but disabled sync: Calendar, Gmail, etc. After that, I still had to reboot the phone - and that fixed the freezing. The Gmail account is still there, with sync enabled - and it's not causing problems.

You could try disabling MicroG completely, to see if that makes the bug go away? (Assuming you have that option, that is. I'm using LineageOS for MicroG, so there's "disable" instead of "uninstall". If you have to uninstall MicroG, that will probably mess up your push notifications even if you reinstall it...)