Solutions to errors in virtual machine running in Android studio

When starting the virtual machine in Android studio, there may be an error message in the “event log” of the main interface. At this time, the virtual machine can still run.

1. Solution to failed to open/qemu.conf

“Emulator: error | failed to open/qemu.conf, err: 2” (Figure 1 ②) is displayed in “event log” (Figure 1 ①), and the error message is “failed to open qemu.conf file”.

1.1 qemu.conf file

QEMU is a set of simulation software that can simulate another set of operating system in Windows operating system. Because it can simulate a virtual CPU in the system, and then hand over the operating system to be simulated to the virtual CPU for processing, it can achieve the purpose of executing two operating systems on the same platform at the same time.

Qemu.conf is the configuration file of Android studio virtual machine. When the virtual machine starts, you need to read the information of the configuration file. By default, the configuration file is in the root directory of drive C.

1.2 solutions

Create qemu.conf file in the root directory of drive C. First, open “this computer” on the desktop, click “view” in the toolbar (Figure 2 ①), and then select “file extension” (Figure 2 ②). The purpose of this operation is to display the file extension so that the file extension is changed to “conf”.

 

Figure 2 shows the file extension

Then, create a new text file in the root directory of drive C and rename it “QEMU. Conf”, as shown in Figure 3.

Figure 3 qemu.conf file

Run the simulator again at this time, and the above error prompt will not appear again.

2. Solution to unexpected system image feature string

When the simulator is running, “emulator: warning | unexpected system image feature string. Emulator may not function correctly.please try updating the emulator” is displayed in “event log”. The prompt means “unexpected system image feature string. The virtual machine may not work properly. Please update the virtual machine.”

 

Figure 4 warning message

For such error messages, you can lower the API level of the virtual machine. For example, if the API level of the current virtual machine is 30 and the above warning information will be displayed, delete the virtual machine and create a virtual machine with API level 29, as shown in Figure 5.

 

Figure 5 virtual machine API level  

 

Read More: