Unable to start android emulator with ERROR: There's another emulator instance running with the current AVD
Solution 1
I managed to fix the problem by removing a lock file created by avd manager.
rm ~/.android/avd/Nexus_5_API_25.avd/hardware-qemu.ini.lock
Emulator have been running without problems once I removed the file.
Solution 2
In Linux it could also be caused by the AVD having been created by root while another user tries to run the emulator. In this case changing the owner of the avd folder contents should help resolve it.
sudo chown -R YOUR_USER. avd
Solution 3
I had the same issue, even though no other emulator was running.
In my case, the file system holding the avd
directories was mounted read only. Remounting it rw
solved the problem
mount -o remount,rw /path/to/avd/file/system
Related videos on Youtube
Josef Adamcik
I am an experienced software developer. https://adamcik.me
Updated on September 15, 2022Comments
-
Josef Adamcik over 1 year
Using CLI and running emulator with following command:
./emulator -use-system-libs @Nexus5API25
Displays only error and an emulator does not start.
emulator: ERROR: There's another emulator instance running with the current AVD 'Nexus5API25'. Exiting...
And:
- There isn't any running emulator instance.
- Nexus5API25 does exist and was working in the past.
- I have to use -use-system-libs flag on my machine to start an emulator instance.
- Other AVD is working.
When executed with -verbose there are more details printed but I don't see anything what would help me to solve the problem:
emulator:Android emulator version 26.1.3.0 (build_id 4205252) (CL:e55642d861e04276b2fa453bfaff4a836f3a3269) emulator:Found AVD name 'Nexus5API25' emulator:Found AVD target architecture: x86_64 emulator:argv[0]: './emulator'; program directory: '/home/developer/opt/Android/Sdk/emulator' emulator: Found directory: /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64/ emulator:Probing for /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu: file exists emulator:Auto-config: -engine qemu2 (based on configuration) emulator: Found directory: /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64/ emulator:try dir /home/developer/opt/Android/Sdk/emulator emulator:Found target-specific 64-bit emulator binary: /home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64 emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64' emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_swiftshader' emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_angle' emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_angle9' emulator:Adding library search path: '/home/developer/opt/Android/Sdk/emulator/lib64/gles_angle11' emulator: Adding library search path for Qt: '/home/developer/opt/Android/Sdk/emulator/lib64/qt/lib' emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=/home/developer/opt/Android/Sdk/emulator/lib64/qt/plugins emulator: Running :/home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64 emulator: qemu backend: argv[00] = "/home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64" emulator: qemu backend: argv[01] = "-verbose" emulator: qemu backend: argv[02] = "-use-system-libs" emulator: qemu backend: argv[03] = "@Nexus5API25" emulator: Concatenated backend parameters: /home/developer/opt/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64 -verbose -use-system-libs @Nexus5API25 emulator: Android virtual device file at: /home/developer/.android/avd/Nexus5API25.ini emulator: virtual device content at /home/developer/.android/avd/Nexus_5_API_25.avd emulator: virtual device config file: /home/developer/.android/avd/Nexus_5_API_25.avd/config.ini emulator: using core hw config path: /home/developer/.android/avd/Nexus_5_API_25.avd/hardware-qemu.ini emulator: Found AVD target API level: 25 emulator: Read property file at /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//build.prop emulator: No boot.prop property file found. emulator: found skin 'nexus_5' in directory: /home/developer/opt/Android/Sdk/skins/ emulator: autoconfig: -skin nexus_5 emulator: autoconfig: -skindir /home/developer/opt/Android/Sdk/skins/ emulator: autoconfig: -kernel /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu emulator: Target arch = 'x86_64' emulator: Auto-detect: Kernel image requires new device naming scheme. emulator: Auto-detect: Kernel does not support YAFFS2 partitions. emulator: autoconfig: -ramdisk /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//ramdisk.img emulator: Using initial system image: /home/developer/opt/Android/Sdk/system-images/android-25/google_apis/x86_64//system.img emulator: No vendor image emulator: autoconfig: -data /home/developer/.android/avd/Nexus_5_API_25.avd/userdata-qemu.img emulator: autoconfig: -initdata /home/developer/.android/avd/Nexus_5_API_25.avd/userdata.img emulator: autoconfig: -cache /home/developer/.android/avd/Nexus_5_API_25.avd/cache.img emulator: autoconfig: -sdcard /home/developer/.android/avd/Nexus_5_API_25.avd/sdcard.img emulator: Physical RAM size: 1536MB emulator: VM heap size 128MB is below hardware specified minimum of 384MB,setting it to that value emulator: System image is read only emulator: Found 1 DNS servers: 127.0.0.53 emulator: ERROR: There's another emulator instance running with the current AVD 'Nexus5API25'. Exiting...
I know I can delete the AVD and create new one. But Is there a way to fix the problem with existing AVD without recreating it?
-
Josef Adamcik over 6 yearsAlready tried that but there's no running emulator process so nothing to kill.
-
Victor Hugo Montes over 6 yearsHow about the command: adb shell ps Can you see something?
-
Victor Hugo Montes over 6 yearsIf you find a PID try this to kill adb shell kill <PID>
-
Josef Adamcik over 4 years@neena, sorry, I have no idea. I use only Linux and MacOs for development and I believe the android emulator on Windows doesn't use Qemu so it might be completely different problem and/or solution. The question is tagged with [linux] since it is OS specific.
-
Mr. Goldberg over 3 yearsAlso needed to
rm ~/.android/avd/Nexus_5_API_25.avd/multiinstance.lock