3

My android emulator (api 30 without play store) is displaying this error dialog from time to time:

enter image description here

I click in "Close app" and the screen goes black for an instant and then everything is working again.

When it happens I get a stacktrace like that in Logcat:

2021-02-18 14:44:21.877 9796-15936/system_process E/ActivityManager: ANR in com.android.systemui
    PID: 15778
    Reason: executing service com.android.systemui/.dump.SystemUIAuxiliaryDumpService
    Load: 0.02 / 0.13 / 0.34
    ----- Output from /proc/pressure/memory -----
    some avg10=0.00 avg60=0.00 avg300=0.00 total=2958378
    full avg10=0.00 avg60=0.00 avg300=0.00 total=753369
    ----- End output from /proc/pressure/memory -----
    
    CPU usage from 168833ms to 0ms ago (2021-02-18 14:41:31.636 to 2021-02-18 14:44:20.468):
      2.5% 9796/system_server: 1.9% user + 0.6% kernel / faults: 31696 minor
      0.7% 293/android.hardware.bluetooth@1.1-service.sim: 0.7% user + 0% kernel
      0.4% 9954/com.android.bluetooth: 0.3% user + 0.1% kernel / faults: 294 minor
      0.3% 313/android.hardware.sensors@2.1-service.multihal: 0% user + 0.2% kernel
      0.2% 303/android.hardware.graphics.composer@2.3-service: 0.2% user + 0% kernel
      0.1% 10165/com.android.phone: 0% user + 0% kernel / faults: 107 minor
      0.1% 444/llkd: 0% user + 0% kernel / faults: 24 minor
      0% 9024/kworker/u8:0-events_unbound: 0% user + 0% kernel
      0% 382/adbd: 0% user + 0% kernel
      0% 10426/com.google.android.gms.persistent: 0% user + 0% kernel / faults: 76 minor
      0% 15861/kworker/u8:3-kverityd: 0% user + 0% kernel
      0% 14944/com.google.android.youtube: 0% user + 0% kernel / faults: 56 minor
      0% 171/logd: 0% user + 0% kernel / faults: 6 minor
      0% 10059/android.hardware.gnss@2.0-service.ranchu: 0% user + 0% kernel
      0% 10/rcu_preempt: 0% user + 0% kernel
      0% 14581/com.google.android.apps.youtube.music: 0% user + 0% kernel / faults: 42 minor
      0% 9762/netd: 0% user + 0% kernel / faults: 36 minor
      0% 12125/com.google.android.apps.messaging: 0% user + 0% kernel / faults: 21 minor
      0% 12334/com.google.android.ims: 0% user + 0% kernel / faults: 10 minor
      0% 173/servicemanager: 0% user + 0% kernel
      0% 362/logcat: 0% user + 0% kernel
      0% 9/ksoftirqd/0: 0% user + 0% kernel
      0% 15/migration/1: 0% user + 0% kernel
      0% 16/ksoftirqd/1: 0% user + 0% kernel
      0% 21/ksoftirqd/2: 0% user + 0% kernel
      0% 26/ksoftirqd/3: 0% user + 0% kernel
      0% 172/lmkd: 0% user + 0% kernel
      0% 174/hwservicemanager: 0% user + 0% kernel
      0% 182/vold: 0% user + 0% kernel / faults: 6 minor
      0% 204/jbd2/dm-5-8: 0% user + 0% kernel
      0% 287/statsd: 0% user + 0% kernel / faults: 1 minor
      0% 304/android.hardware.health@2.1-service: 0% user + 0% kernel
      0% 385/traced_probes: 0% user + 0% kernel
      0% 439/android.hardware.biometrics.fingerprint@2.1-service: 0% user + 0% kernel
      0% 478/netmgr: 0% user + 0% kernel
      0% 10080/com.android.networkstack.process: 0% user + 0% kernel / faults: 31 minor
      0% 14525/kworker/2:2-events: 0% user + 0% kernel
      0% 15069/logcat: 0% user + 0% kernel
      0% 15631/kworker/1:1-events_power_efficient: 0% user + 0% kernel
    1.5% TOTAL: 0.7% user + 0.4% kernel + 0% iowait + 0.2% irq + 0% softirq
    CPU usage from 20ms to 322ms later (2021-02-18 14:44:20.488 to 2021-02-18 14:44:20.791):
      26% 9796/system_server: 15% user + 11% kernel / faults: 292 minor
        22% 15936/AnrConsumer: 15% user + 7.6% kernel
    8.3% TOTAL: 5% user + 3.3% kernel

Since my own app doesn't close and there is nothing on the stacktrace referring to it and it seems to happen when I'm running any application in this emulator instance I suppose the problem is in the emulator itself and not on my own apps.My other api emulators don't suffer from this problem.

This another question seems to point to a similar problem but I'm not using flutter and I've also tried some of it's solutions but with no success.

Did someone else had the the same problem and was able to solve it? How have you solved it?

NOTE: I've searched on stack overflow for this particular problem and was able to find some other people with the same problem but those questions have no good and working answer. I'm inclined to think that the api 30 emulator is still "problematic" as someone suggested in some of those questions. But it would be nice to find a solution.

Iogui
  • 1,526
  • 1
  • 17
  • 28

1 Answers1

1
  1. Open AVD Manager
  2. Edit config device
  3. Show advanced settings
  4. Go at graphics and select hardware
  5. Save and try again

If graphics haven't selectable...

Go at

C:\Users\YOUR_USERNAME\.android\avd\YOUR_DEVICE.avd

and in config.ini archive edit hw.gpu.mode = auto for hw.gpu.mode = host

Save, exit, restart Android Studio and emulate your device again.

Diogo Santos
  • 61
  • 1
  • 2