Android emulation not working on Mac - error XA0010: Could not retrieve the Android ABI for the attached device or emulator.

See original GitHub issue

Description

I followed the tutorial for installing MAUI on Mac. https://github.com/dotnet/maui/wiki/macOS-Install

But no matter what I do, when I execute the following command, it cannot run the emulator and throws this error(see below):

> dotnet build -t:Run -f net6.0-android

MyMauiApp -> /Users/-USERNAME-/projects/ryder-poc/MyMauiApp/bin/Debug/net6.0-android/MyMauiApp.dll
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.415/tools/Xamarin.Android.Common.Debugging.targets(611,5): error XA0010: Could not retrieve the Android ABI for the attached device or emulator. Please reconnect the device or restart the emulator, and try again. [/Users/-USERNAME-/projects/ryder-poc/MyMauiApp/MyMauiApp.csproj]

Build FAILED.

/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.415/tools/Xamarin.Android.Common.Debugging.targets(611,5): error XA0010: Could not retrieve the Android ABI for the attached device or emulator. Please reconnect the device or restart the emulator, and try again. [/Users/-USERNAME-/projects/ryder-poc/MyMauiApp/MyMauiApp.csproj]
   0 Warning(s)
   1 Error(s)

Steps to Reproduce

> dotnet build -t:Run -f net6.0-android

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

macOS Monterey (On a MacBook Pro (13-inch, 2020, Two Thunderbolt 3 ports)

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dellis1972commented, Feb 8, 2023

@jonathanpeppers so we might be able to improve the error message here. Currently it is

Could not retrieve the Android ABI for the attached device or emulator. Please reconnect the device or restart the emulator, and try again.

We could expand on this.

Could not retrieve the Android ABI for the attached device or emulator with id {0}. Please reconnect the device or restart the emulator, and try again.

This includes the id of the device we are tring to use. It might help users diagnose this issue.

1reaction
timochucommented, Sep 27, 2022

I confirm this error is still happening, me and @brminnick came upon this again.

The project works from Visual Studio Community 2022 when I run it. But not from the command line when running the command:

dotnet build -t:run -f:net6.0-android

returns

/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/32.0.465/tools/Xamarin.Android.Common.Debugging.targets(611,5): error XA0010: Could not retrieve the Android ABI for the attached device or emulator. Please reconnect the device or restart the emulator, and try again. [/Users/timova/Projects/ndc/workshops/crypto-maui/frontend/0-Start/MauiCrypto.csproj]
Visual Studio Community 2022 for Mac Preview
Version 17.4 Preview (17.4 build 1583)
Installation UUID: 47ebfd1d-f28b-4c0d-96d8-105ce36ebcae

Runtime
.NET 6.0.5 (64-bit)
Architecture: X64

Xamarin Designer
Version: 17.4.0.124
Hash: ffbba0c031
Branch: remotes/origin/d17-4
Build date: 2022-09-15 15.36.29 UTC

Roslyn (Language Service)
4.4.0-2.22419.1+ae5663806be933515723b2d5a85faf5d378f460d

NuGet
Version: 6.3.0.128

.NET SDK (x64)
SDK: /usr/local/share/dotnet/sdk/6.0.401/Sdks
SDK Versions:
	7.0.100-rc.1.22431.12
	6.0.401
	6.0.302
	6.0.301
	6.0.300
	6.0.202
	6.0.201
	5.0.406
MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	7.0.0-rc.1.22426.10
	6.0.9
	6.0.7
	6.0.6
	6.0.5
	6.0.4
	6.0.3
	5.0.15

Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
A valid Xcode installation was not found at the configured location: '/Library/Developer/CommandLineTools'

Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

Xamarin.iOS
Version: 15.12.0.2 (Visual Studio Community)
Hash: 87f98a75e
Branch: d17-3
Build date: 2022-07-25 20:18:55-0400

Xamarin.Android
Version: 13.0.99.81 (Visual Studio Community)
Commit: xamarin-android/main/7c9c24b
Android SDK: /Users/timova/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		12.1 (API level 32)
		12.0 (API level 31)
		13.0 (API level 33)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 33.0.2
SDK Build Tools Version: 32.0.0

Build Information: 
Mono: dffa5ab
Java.Interop: xamarin/java.interop/main@2c8b0a8f
SQLite: xamarin/sqlite/3.39.2@40e8743
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@29f11f2

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.4.0.45
Hash: 8cac7ea
Branch: remotes/origin/HEAD~1
Build date: 2022-09-15 15.36.33 UTC

Android Device Manager
Version: 0.0.0.1196
Hash: b2faf27
Branch: main~1
Build date: 2022-09-15 15.36.33 UTC

Build Information
Release ID: 1704001583
Git revision: 70322329919c72a11d9795a3cb403fe4115a5878
Build date: 2022-09-15 15:34:34+00
Build branch: release-17.4
Build lane: release-17.4

Operating System
Mac OS X 12.6.0
Darwin 21.6.0 Darwin Kernel Version 21.6.0
    Mon Aug 22 20:17:10 PDT 2022
    root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
Read more comments on GitHub >

github_iconTop Results From Across the Web

ADB0020: Android ABI mismatch. How do I set ABI of target ...
Forms Android application, Right click on your android project and then select Properties > Android Options > Advanced. You will see a dropdown ......
Read more >
Troubleshoot known issues with Android Emulator
This page lists known issues, workarounds, and troubleshooting tips for the Android Emulator. If you encounter an issue not listed here or ...
Read more >
Android Emulator Troubleshooting - Xamarin
This article explains how to diagnose and work around problems that may occur when using the Android Emulator.
Read more >
My Journey to Setup Android Emulator for M1 MacBook Pro
My first impression of setting up Android App Development on an M1 MacBook Pro is not as positive as I hope to get...
Read more >
Xamarin Visual Studio – Error ADB0020 Android ABI ...
Here is how you can resolve it. In Solution Explorer select your project. Right-click and select Properties or press Alt+Enter. Select Android ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found