When developing Flutter applications, encountering errors during the setup and configuration of the Android emulator is not uncommon. One such error message that developers may come across is:
Starting device daemon...
[ERR] Error 1 retrieving device properties for sdk gphone64 x86 64:
[ERR] adb.exe: device 'emulator-5554' not found
[ERR] The Android emulator exited with code 1 during startup
[ERR] Android emulator stderr:
[ERR] ERROR | Running multiple emulators with the same AVD
[ERR] ERROR | is an experimental feature.
[ERR] ERROR | Please use -read-only flag to enable this feature.
[ERR] Address these issues and try again.
The error message suggests issues related to the Android emulator setup, specifically regarding the device properties retrieval and emulator startup. The mention of ’emulator-5554′ not found and the experimental feature related to running multiple emulators with the same AVD indicate potential conflicts and misconfigurations.
Solutions:
Check Emulator Status: Before proceeding with any troubleshooting steps, ensure that no instances of the Android emulator are currently running. If there are, close them to prevent conflicts.
Restart ADB: Restarting the Android Debug Bridge (ADB) server can often resolve connection issues with the emulator. Run the following commands in your terminal or command prompt:
adb kill-server
adb start-server
Use -read-only
Flag: As suggested in the error message, the -read-only
flag is an experimental feature that might address the issue. Launch the emulator with this flag in the AVD Manager.
Verify AVD Configuration: Open the AVD Manager and review the configuration of the Android Virtual Device (AVD) you are trying to use. Ensure that it is correctly set up, matching the specifications required by your Flutter app.
Update Emulator and SDK: Ensure that you have the latest version of the Android emulator and SDK tools installed. Use Android Studio’s SDK Manager to check for updates and install them.
Check Virtualization: Some systems require virtualization to be enabled in the BIOS/UEFI settings. Verify that virtualization is enabled on your machine, as it is essential for proper emulator functioning.
Restart Android Studio: A simple restart of Android Studio can sometimes resolve issues related to the IDE’s connection to the emulator.
Now, it is working