Issue
I am using a brand new xamarin.forms solution generated with the flyout shell template in VS 2022 community edition.
When I open the emulator and follow the first time setup, where it generates a common android device I get this error when trying to launch the emulator. I also get this error when creating a device myself.
Unknown AVD Name Error <- This part has been fixed by setting the ANDROID_SDK_HOME variable to the correct directory in the Environment Variables in system settings. But the emulator can still not be used for debugging.
I have tried looking around for solutions on all sorts of forums to get the emulator to work, but didn't find anything that made a difference.
I have tried running on a local device using USB instead as it was suggested that it was easier to get to work then the emulator, which didn't work either. The device does not show up in the Android Emulator drop-down menu. I then tried different cables and it still did not show up as a detected device.I then tried via wireless connection just in case something was up with the cables. It still doesn't show up. But if I check the devices through the adb command prompt I can see the device is connected and authorized, both when using the cable and when using the wireless connection. And the computer itself detects the device just fine.
- The Device is in developer mode.
- USB debugging is on.
- The computer is approved as a trusted device.
- Android project is set as start up project.
- SDK's and tools have been downloaded using the Android SDK manager.
- USB drivers have been downloaded for the device.
I have already tried
- closing and opening VS multiple times.
- Unloading and reloading the project.
- Setting the device to PTP mode instead.
- Reinstalling VS including deleting and regenerating the Java and Android folders.
- Uninstalling VS 2022 and trying 2019 instead.
- Generating a new VS solution.
- downloading and installing the JDK manually.
- Seeing that Virtual emulation is on in the BIOS.
- Making sure the system is able to run Hyper-V and that it is on.
- checking that the folder paths are set correctly in the options menu.
- Making sure all nuget packages are up to date.
Any suggestions would be highly appreciated as I cannot debug and test the device properly at the moment.
Solution
I ended up wiping the hard-drive and starting from scratch. This time all I had to do was install VS and enable Hyper-v and everything worked as it should right away.
I have absolutely zero idea what caused this issue, but a complete wipe fixed it.
Answered By - Uni-jos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.