Issue
I'm trying to run my first .net maui project. I have my Windows 11 pro virtual machine running on Windows 11 Home host.
I have the pre-requisites configured.
- Installed VS 2022 17.3.0.
- Installed
.Net Multi-platform App UI Development.
- Enabled
Hyper-Vin windows features.
- Run VS 2022 as Administrator.
- Create
.Net Maui Default App. - Run via Android
Pixel 5 - API 31 (Android 12.0 - API 31)emulator. - Deploy failed Emulator cannot be started.
Output:
Build started...
Starting emulator pixel_5_-_api_31 ...
1>------ Build started: Project: MauiApp1, Configuration: Debug Any CPU ------
C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -netfast -avd pixel_5_-_api_31 -prop monodroid.avdname=pixel_5_-_api_31
Emulator pixel_5_-_api_31 cannot be started.
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>MauiApp1 -> C:\Users\Abdul Rahman\source\repos\MauiApp1\MauiApp1\bin\Debug\net6.0-android\MauiApp1.dll
2>------ Deploy started: Project: MauiApp1, Configuration: Debug Any CPU ------
2>Starting deployment to pixel_5_-_api_31 ...
2>Starting emulator pixel_5_-_api_31 ...
2>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -netfast -avd pixel_5_-_api_31 -prop monodroid.avdname=pixel_5_-_api_31
2>Emulator pixel_5_-_api_31 cannot be started.
2>Deploy failed
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Please assist on what I'm missing.
Solution
Jason thanks for your inputs. Here is how I solved using a physical android device.
Steps:
- Enable
Developer Optionsin your Mobile device - Enable
USB debuggingin your Mobile device
- Connect your device to your virtual machine. A popup titled
Allow USB Debugging?appers in phone. Allow it.
- Open
MAUIproject - From the
Project run dropdownselectAndroid Local Devicesand select your device.
- Now run the app.
- It will be deployed in your device and open in your device.
- A preview will appear in
XAML Live Previewwindow inside visual studio.
Answered By - fingers10







0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.