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.
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
Error running app: Device is Already Activating.
There are different ways to fix this problem:
Navigate down to the arrow and follow it to click on this link indicating Show on Disk as shown in the attached image.
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.
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
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.
You may get into error saying File in Use when deleting multiinstance.lock file.
In that case open Window's task manager(activity monitor in Mac) and selected qemu-system-x86_64.exe and press End task
Windows
taskkill /F /PID /PIDnumber
Mac/Windows
adb emu kill
adb kill-server
This is the last option
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.
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.
Reference links :