Search code examples
c#androidvisual-studioadbmaui

.NET MAUI emulator is not ready to be used


I have installed x86 android emulator with API 21 to get higher performance. when I try to start debugging on it, I get 'There were deployment errors' and in the output window:

Waiting for emulator to be ready...
Emulator is not ready to be used.

I have followed this answer with no luck

I have tried to deploy manually to see if the issue is from the emulator or Visual Studio

  1. I have published the app to an apk
  2. and using the adb tool found in 'C:\Program Files (x86)\Android\android-sdk\platform-tools' I installed the apk using the command adb install <apk_file_path>.it installed the apk successfully and I can launch the app
  3. then I tried to start the app using adb tool so I ran the command adb shell am start -n com.package.name/.MainActivity I got:

Error type 3
Error: Activity class {com.package.name/com.package.name.MainActivity} does not exist.
Failed to launch android application

  1. so I added Name property on the Activity attribute on the MainActivity class and I have set it to "com.package.name.MainActivity", after adding this property and reinstalling the app it worked properly using adb but still same issue in Visual Studio

I have also tried cleaning project, but it did not work. And the same issue also happened on x64 emulator. I have an AMD CPU that supports virtualization and virtualization is enabled in BIOS.

Edit: I have tried to install API 34 but when I try to deploy the app to it, I get

adb0010: mono.androidtools.installfailedexception: failure [install_failed_deprecated_sdk_version: app package must target at least sdk version 23, but found 21]


Solution

  • I have found an issue related to this question on GitHub #5782. the solution that worked for me is disabling the fast deployment for android from {project} properties > Android > Options: enter image description here then reinstalling the emulator and the SDK.