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

clang++ exited with code 1: building for 'iOS', but linking in object file libswiftCompatibility50.a[arm64][7](Overrides.cpp.o) built for 'iOS-simulator' #22231

Open
FlavioGoncalves-Cayas opened this issue Feb 21, 2025 · 2 comments
Labels
need-attention An issue requires our attention/response
Milestone

Comments

@FlavioGoncalves-Cayas
Copy link

Description

Hello,

I am having issues building my net9.0 MAUI app for iOS on Azure DevOps, while it works perfectly fine locally. I already compared the workloads, sdks and XCode versions.

Here is the error I am receiving:

/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.2/18.2.9180/targets/Xamarin.Shared.Sdk.targets(1665,3): error : clang++ exited with code 1: [redacted.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.2/18.2.9180/targets/Xamarin.Shared.Sdk.targets(1665,3): error : ld: building for 'iOS', but linking in object file (/Applications/Xcode_16.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libswiftCompatibility50.a[arm64][7](Overrides.cpp.o)) built for 'iOS-simulator' [redacted.csproj]
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.2/18.2.9180/targets/Xamarin.Shared.Sdk.targets(1665,3): error : clang++: error: linker command failed with exit code 1 (use -v to see invocation) [redacted.csproj]

This is the pipeline configuration:

vmImage: macOS-15
.NET SDK: 9.0.102
XCode: 16.2
workloads:
  ios                        18.2.9180/9.0.100      SDK 9.0.100        
  maui                       9.0.14/9.0.100         SDK 9.0.100        
  maui-ios                   9.0.14/9.0.100         SDK 9.0.100 

I am using dotnet publish:

dotnet publish redacted.csproj -f net9.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"

Any ideas on how to fix it, or what's the underlying issue?

I am also wondering why it says Xcode_16.app in the error, when I specifically selected XCode 16.2 with sudo xcode-select -s /Applications/Xcode_16.2.app

@rolfbjarne maybe it's more of a macios issue?

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.30 SR3

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

No response

Did you find any workaround?

No response

Relevant log output

@rolfbjarne
Copy link
Member

I am also wondering why it says Xcode_16.app in the error, when I specifically selected XCode 16.2 with sudo xcode-select -s /Applications/Xcode_16.2.app

That's probably the issue.

Check if this file exists, and if it does, just delete it:

~/Library/Preferences/Xamarin/Settings.plist

For more information see: #11172 (comment)

@rolfbjarne rolfbjarne transferred this issue from dotnet/maui Feb 21, 2025
@rolfbjarne rolfbjarne added need-info Waiting for more information before the bug can be investigated and removed t/bug labels Feb 21, 2025
@rolfbjarne rolfbjarne added this to the Future milestone Feb 21, 2025
@FlavioGoncalves-Cayas
Copy link
Author

FlavioGoncalves-Cayas commented Feb 24, 2025

@rolfbjarne thanks for the reply.

cat ~/Library/Preferences/Xamarin/Settings.plist returns no such file or directory

So it looks like that is not the issue.

Also xcode-select -p returns /Applications/Xcode_16.2.app/Contents/Developer as expected, after sudo xcode-select -s /Applications/Xcode_16.2.app

@dotnet-policy-service dotnet-policy-service bot added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-attention An issue requires our attention/response
Projects
None yet
Development

No branches or pull requests

2 participants