2

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

  • Android SDK Platform 29
  • Intel x86 Atom_64 System Image
  • Google APIs Intel x86 Atom_64 System Image
  • Google APIs Intel x86 Atom System Image

Similar for 9.0, 8.1, 7.1, 7.0, 6.0

Version details - Version is 8.6.2 (build 6)

  • Android SDK Manager

    • Version: 16.6.0.50
    • Hash: 5901879
    • Branch: remotes/origin/d16-6
    • Build date: 2020-04-30 04:01:22 UTC
  • Android Device Manager

    • Version: 16.6.0.95
    • Hash: 45d17b5
    • Branch: remotes/origin/d16-6
    • Build date: 2020-04-30 04:01:42 UTC
  • Xamarin.Android

    • Version: 10.3.1.4 (Visual Studio Community)
    • Commit: xamarin-android/d16-6/3a10de9
  • Android SDK: /Users/user/Library/Developer/Xamarin/android-sdk-macosx

  • Supported Android versions:
    • 6.0 (API level 23)
    • 7.1 (API level 25)
    • 8.0 (API level 26)
    • 8.1 (API level 27)
Steve
  • 729
  • 14
  • 29
  • You can refer to this thread to make a troubleshoting. https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/troubleshooting?pivots=macos, you can open the command window, run `adb devices`, if you can get the emulator. If you running your emulator, can you get the log? – Leon Jun 11 '20 at 07:02

2 Answers2

1

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.

Steve
  • 729
  • 14
  • 29
  • I'm facing the same issue! Thanks for posting a solution. I'm wondering additionally, if it is possible to create the devices from the terminal/console on Mac. – vhugo Jul 02 '20 at 12:11
  • It appears the fix will be released soon: "A fix for this issue has been internally implemented and is being prepared for release. We’ll update you once it becomes available for download." -- Microsoft. https://developercommunity.visualstudio.com/content/problem/1052380/message-when-creating-android-device-invalid-emula.html – vhugo Jul 02 '20 at 12:21
1

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

Maksud Alam
  • 169
  • 1
  • 3