Rohan Pande
Rohan Pande

Reputation: 285

Facing an emulator issue in Android: "Error: Device is Already Activating"

I have updated my Android SDK from API 32 to API 34. Currently, after updating I am facing an issue where I am unable to start the emulator. However, I am able to run my application on a real device.

Message that I get when I start the emulator:

Error running app: Device is Already Activating

I have tried this link but seems to be not resolvable the error for me: https://medium.com/@gvpraveen.ravi/resolving-the-device-is-already-activating-error-a-step-by-step-guide-to-fixing-adb-conflicts-32cb9438c816

I tried re-creating the emulators, reinstalled the Android SDK but still facing the same issue.

enter image description here

enter image description here

I have checked the Android studio logs but I couldn't completely understand it. What can I try next?

Android Studio version: Android Studio Jellyfish | 2023.3.1

2024-05-20 11:21:52,267 [ 352923] SEVERE - #c.i.o.p.Task - Device is already activating com.android.sdklib.deviceprovisioner.DeviceActionDisabledException: Device is already activating at com.android.sdklib.deviceprovisioner.LocalEmulatorProvisionerPlugin$LocalEmulatorDeviceHandle$internalStateFlow$1.invokeSuspend(LocalEmulatorProvisionerPlugin.kt:417) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) 2024-05-20 11:21:52,273 [ 352929] SEVERE - #c.i.o.p.Task - Android Studio Jellyfish | 2023.3.1 Build #AI-233.14808.21.2331.11709847 2024-05-20 11:21:52,273 [ 352929] SEVERE - #c.i.o.p.Task - JDK: 17.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 2024-05-20 11:21:52,274 [ 352930] SEVERE - #c.i.o.p.Task - OS: Windows 11 2024-05-20 11:21:52,274 [ 352930] SEVERE - #c.i.o.p.Task - Last Action: Run 2024-05-20 11:21:52,563 [ 353219] INFO - #o.j.p.g.GradleManager - Instructing gradle to use java from D:\TW\Tools\Java 2024-05-20 11:21:52,664 [ 353320] INFO - #com.android.tools.idea.diagnostics.error.AndroidStudioErrorReportSubmitter - Exception signature: com.android.sdklib.deviceprovisioner.DeviceActionDisabledException at com.android.sdklib.deviceprovisioner.LocalEmulatorProvisionerPlugin$LocalEmulatorDeviceHandle$internalStateFlow$1.invokeSuspend-cf11dc37, report ID: b02f79cdb6cff2f3 2024-05-20 11:21:56,989 [ 357645] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities to files

Upvotes: 7

Views: 6196

Answers (4)

Bob
Bob

Reputation: 2858

Error running app: Device is Already Activating.


There are different ways to fix this problem:

1. Delete .lock Files

Navigate down to the arrow and follow it to click on this link indicating Show on Disk as shown in the attached image.

enter image description here

It will list all the files in the directory you are in, including the one that caused the problem, the “hardware-qemu. ini. lock” file, and then you run it again. Files that need to be deleted should be the one with ‘. lock’ in its file name.

enter image description here

Go to (Windows)

C:\Users{username}.android\avd/Nexus_5X_API_26.avd

Or (Ubuntu)

~/.android/avd/name.avd/Nexus_5X_API_26.avd

Or (Mac M2)

/Users/{username}/.android/avd/Pixel_2_API_32.avd/hardware-qemu.ini.lock

2. Stop AVD

AVD Manager should be opened, the right-click at the down-arrow and select stop AVD. You do not need to restart or recreate the emulator in order to get rid of this type of problem.

enter image description here

You may get into error saying File in Use when deleting multiinstance.lock file.

enter image description here

In that case open Window's task manager(activity monitor in Mac) and selected qemu-system-x86_64.exe and press End task

Windows :

https://i.sstatic.net/Mi39y.png

Mac :

enter image description here

3. Kill Simulator Task

Windows

taskkill /F /PID /PIDnumber

Mac/Windows

adb emu kill

adb kill-server

4. restart the computer

This is the last option

Note :

I would suggest to use android studio hedgehog and ignore Android Studio Jellyfish for now till development team fixes it. The problem actually arise in low end systems of windows and Mac having SATA SSD and with NVME SSD android studio doesn't gives this type of error and solution I had provided is an alternative to it.

Read post from here

NVMe SSD is faster when it comes to data transfer rate. NVMe PCIe 3.0 connector can reach up to 3,600 MB/s, while the newer NVMe PCIe 4.0 generation can reach a transfer rate of up to 7,500 MB/s. By contrast, SATA SSD drives can reach a maximum transfer rate speed of just 600 MB/s. NVMe has much lower latency compared to SATA SSDs, making it faster for small, random I/O operations, which are common in IDE operations.

enter image description here

Reference links :

  1. https://developer.android.com/studio/releases/fixed-bugs/studio/2023.3.1

  2. https://developer.android.com/studio/run/managing-avds

  3. https://developer.android.com/studio/run/emulator

Upvotes: 7

MathiasTCK
MathiasTCK

Reputation: 329

I get this error when I pick an emulator instance, start it, then without delay tell my app to run, picking that instance. If the device hadn't been running then telling my app to run would start it, I believe my timing was catching it in between. I basically just want it to retry one more time rather than error saying: "Device is already activating"

Upvotes: 1

Mhmd Dsoki
Mhmd Dsoki

Reputation: 1

The best solution if you don't need a google play store on your device ,chose a device that doesn't have a play store,then complete your creation for the device and it will run your app on the emulator very well till they fix it , this solution works fine

https://i.sstatic.net/kEg1gVMb.png

Upvotes: 0

LordTAO
LordTAO

Reputation: 182

A temporary solution. I take the Canary version from https://developer.android.com/studio/preview. It's solved the issue.

Upvotes: 1

Related Questions