Skip to content

[.NET 6] Deploy fails on x86_64 API 31 emulator #6353

Description

@jonathanpeppers

Steps to Reproduce

  1. Setup x86_64 API 31 emulator
  2. dotnet new android
  3. dotnet build -t:Install

Fails with:

C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.101-preview.9.16\tools\Xamarin.Android.Common.Debugging.targets(611,5): error ADB0020: Mono.AndroidTools.IncompatibleCpuAbiExceptiopn: The package does not support the CPU architecture of this device.
   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Internal/AdbOutputParsing.cs:line 349
   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass104_0.<InstallPackage>b__0(Task`1 t) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/AndroidDevice.cs:line 804
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__271_0(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:line 206
   at AndroidDeviceExtensions.PushAndInstallPackageAsync(AndroidDevice device, PushAndInstallCommand command, CancellationToken token) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/external/androidtools/Xamarin.AndroidTools/Devices/AndroidDeviceExtensions.cs:line 223
   at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/Tasks/FastDeploy.cs:line 339
   at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/Tasks/FastDeploy.cs:line 356
   at Xamarin.Android.Tasks.FastDeploy.RunTaskAsync() in /Users/builder/azdo/_work/1/s/xamarin-android/external/monodroid/tools/msbuild/Tasks/FastDeploy.cs:line 213 [C:\src\foo\foo.csproj]

Same thing works with:

dotnet build -t:Install -c Release -p:AndroidPackageFormat=apk

It also works fine in legacy Xamarin.Android

Version Information

Latest .NET 6 rc 2 bits.

Activity

  1. added this to the .NET 6 milestone on Sep 30, 2021
  2. jonathanpeppers commented on Oct 11, 2021

    @jonathanpeppers
    MemberAuthor

    So the issue seems to be the API 31 emulator dropped x86?

    > adb shell getprop | grep cpu
    [ro.product.cpu.abi]: [x86_64]
    [ro.product.cpu.abilist]: [x86_64,arm64-v8a]
    [ro.product.cpu.abilist32]: []
    [ro.product.cpu.abilist64]: [x86_64,arm64-v8a]
    [ro.system.product.cpu.abilist]: [x86_64,arm64-v8a]
    [ro.system.product.cpu.abilist32]: []
    [ro.system.product.cpu.abilist64]: [x86_64,arm64-v8a]
    [ro.vendor.product.cpu.abilist]: [x86_64,arm64-v8a]
    [ro.vendor.product.cpu.abilist32]: []
    [ro.vendor.product.cpu.abilist64]: [x86_64,arm64-v8a]
    

    But the API 30 emulator shows:

    > adb shell getprop | grep cpu
    [ro.product.cpu.abi]: [x86_64]
    [ro.product.cpu.abilist]: [x86_64,x86,arm64-v8a,armeabi-v7a,armeabi]
    [ro.product.cpu.abilist32]: [x86,armeabi-v7a,armeabi]
    [ro.product.cpu.abilist64]: [x86_64,arm64-v8a]
    

    So even classic Xamarin.Android projects fail on my API 31 emulator if I use <AndroidSupportedAbis>x86</AndroidSupportedAbis>.

  3. akoeplinger commented on Oct 11, 2021

    @akoeplinger
    Member

    Yeah this is mentioned in https://developer.android.com/about/versions/12/get?hl=en-US#on_emulator

    Note that 32-bit Android emulator system images are not supported in Android 12.

  4. added a commit that references this issue on Oct 22, 2021
  5. ghost locked as resolved and limited conversation to collaborators on Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions