maui: clang++ exited with code 1
Description
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7089\targets\Xamarin.Shared.Sdk.targets(1274,3): error : ld: in /Users/erichbrunner/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c7d11821f579f7be20cca70bea58f9077387ac6e7fda6c0f0bf0598883d8d781/obj/Debug/net7.0-ios**/iossimulator-arm64**/linker-cache/AppCenterCrashes.a(MSACErrorReport.o), building for iOS Simulator, but linking in object file built for iOS, file ‘/Users/erichbrunner/Library/Caches/Xamarin/mtbs/builds/MauiApp1/c7d11821f579f7be20cca70bea58f9077387ac6e7fda6c0f0bf0598883d8d781/obj/Debug/net7.0-ios/iossimulator-arm64/linker-cache/AppCenterCrashes.a’ 1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7089\targets\Xamarin.Shared.Sdk.targets(1274,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) 1>Done building project “MauiApp1.csproj” – FAILED.
Steps to Reproduce
- XCode
-
Visual Studio
-
Installed Workloads
Link to public reproduction project repository
https://github.com/ericbrunner/MauiClangError.git
Version with bug
maui-ios 8.0.0-preview.7.8842/8.0.100-preview.7 VS 17.7.34009.444 ios 16.4.8694-net8-p7/8.0.100-preview.7 VS 17.7.34009.444
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iPhone 14 iOS 16.1
Did you find any workaround?
No. I tried to set
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'"> <RuntimeIdentifier>iossimulator-arm64</RuntimeIdentifier> </PropertyGroup>
in MAUI .csproj without any working result. Taken from comments of #12124
Relevant log output
see gist of build output pane
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Comments: 15 (8 by maintainers)
Interesting that the .NET MAUI team is not responsible for tooling issues with .NET MAUI. Who is responsible for such one?
If you want to force x64 when building in Visual Studio, add this to your project:
If you’re building from the command line, you need to specify the
iossimulator-x64runtime identifier:You can also condition for Mac, at the top of the csproj there is a condition for windows to add the windows tfm. Just use that and swap to check for macos
Might be better to put in csproj.user so it doesnt mess with debugging on mac.
The underlying issue is that the AppCenter NuGet doesn’t support the ARM64 architecture in the simulator.
The answer in the SO link you posted (https://stackoverflow.com/a/73507083) says to tell Xcode to not build for ARM64 (in the simulator).
The answer I posted yesterday (https://github.com/dotnet/maui/issues/16778#issuecomment-1682434890) is the equivalent for Visual Studio: it tells Visual Studio to not build for ARM64 (in the simulator).
Both of these answers are just workarounds for the underlying problem: that the AppCenter NuGet doesn’t support ARM64 in the simulator.
Maybe this one: https://github.com/microsoft/appcenter-sdk-dotnet?