Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 machines cannot build arm64 native executables #16152

Closed
kevinxufei opened this issue Sep 27, 2022 · 3 comments
Closed

Arm64 machines cannot build arm64 native executables #16152

kevinxufei opened this issue Sep 27, 2022 · 3 comments
Labels
dotnet An issue or pull request related to .NET (6) Mac Catalyst Issues affecting Mac Catalyst macOS Issues affecting macOS
Milestone

Comments

@kevinxufei
Copy link

Affected Branch: release-17.3
Affected Build: 17.3.6 build 20

Configuration:

  • .NET SDK version: 6.0.401
  • MAUI: 6.0.540
  • Xcode: 14.0 (14A309)
  • Xamarin.iOS: 16.0.0.72
  • Xamarin.Mac: 8.12.0.2

Steps to reproduce:

  1. Launch VSMac and create a MacOS Application(Other->Custom) project
  2. Click "Run" button

Actual result:
Debug MacOS Application failed with "Unable to attach to CoreCLR. Unknown Error: 0x80131c3c"
image

image

@rolfbjarne
Copy link
Member

You have to change the RuntimeIdentifier in the project file:

<PropertyGroup>
    <RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
</PropertyGroup>

Admittedly we could probably have a better default value here.

@rolfbjarne rolfbjarne added macOS Issues affecting macOS dotnet An issue or pull request related to .NET (6) Mac Catalyst Issues affecting Mac Catalyst labels Sep 27, 2022
@rolfbjarne rolfbjarne added this to the .NET 8 milestone Sep 27, 2022
@mrward
Copy link
Member

mrward commented Sep 27, 2022

This bug is fixed in VS Mac 17.4, since VS Mac 17.4 will determine the architecture of the executable instead of assuming it is arm64. On the original bug filed against VS Mac I suggested that a bug is filed here for the Microsoft.macOS sdk to see if it should be using x64 by default when on an arm64.

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jun 23, 2023
* When publishing a mobile app, choose a device architecture.
* When targeting a simulator, choose the arm64 version if we're running on an
  arm64 machine.

Fixes xamarin#18455.
Fixes xamarin#16152.
rolfbjarne added a commit that referenced this issue Aug 7, 2023
* When publishing a mobile app, choose a device architecture (as opposed
  to showing an error if none was specified by the developer)
* When building for the simulator, choose the arm64 runtime identifier
  if we're running on an arm64 machine.
* When building a Debug build for desktop, choose the arm64 runtime
  identifier if we're running on an arm64 machine.

Fixes #18455.
Fixes #16152.
Fixes #17841.

Section in the release notes: https://github.com/xamarin/xamarin-macios/wiki/.NET-8-release-notes#default-runtimeidentifiers

---------

Co-authored-by: Alex Soto <[email protected]>
@rolfbjarne
Copy link
Member

Fixed in #18495.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet An issue or pull request related to .NET (6) Mac Catalyst Issues affecting Mac Catalyst macOS Issues affecting macOS
Projects
None yet
Development

No branches or pull requests

3 participants