Steve
Steve

Reputation: 819

Android Emulator not working with Xamarin / Visual Studio Mac

Hi i'm really struggling to get the Android emulator running on my Mac. What are the steps I need to take to get this working?

I've got Visual Studio 2019 on MacOS Catalina

This is on a new blank Xamarin Forms project

I've tried to go Tools > Device Manager > New Device. Pixel 3 XL , x86_64, Q 10.

I keep getting this message:

Android emulator component is incomplete therefore the device Pixel 3 XL Q 10.0 - API 29 could not be created. Do you want us to reinstall the Android Emulator?

I've clicked the button to reinstall the android emulator but it doesnt work.

Also tried with OS 8.1 and setting processor as x86 - all the combinations give a similar error messages

When i go to Tools > SDK Manager, the following are ticked:

Android 10.0 - Q

Similar for 9.0, 8.1, 7.1, 7.0, 6.0

Version details - Version is 8.6.2 (build 6)

Upvotes: 2

Views: 3212

Answers (2)

Maksud Alam
Maksud Alam

Reputation: 249

I am able to solve the issue by creating an XML file named entitlements.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.hypervisor</key>
    <true/>
</dict>
</plist>

Then run the following command

codesign -s - --entitlements entitlements.xml --force /Users/macbookpro/Library/Developer/Xamarin/android-sdk-macosx/emulator/qemu/darwin-x86_64/qemu-system-x86_64

to identify your Android SDK installed folder use Visual Studio> Tools > SDK Manager then check the Android SDK path

enter image description here

Upvotes: 1

Steve
Steve

Reputation: 819

I ended up downloading Android Studio, then running the installers from there and then finally went back to VS Mac and installed an emulator device - that seemed to work.

Upvotes: 1

Related Questions