Reputation: 2951
I recently updated to the latest macos and xcode (14.3) and it's broke my .net build on ios (for the second time).
I've made sure to set the SDK location in Visual Preferences > SDK Locations > Apple and confirmed this in the terminal xcode-select -p
I've tried different versions of xcode
I've tried targeting different versions of .net with a global.json including the most recent(7.0.203)
I've tried targeting different versions of ios, but cannot target higher than 16.4 (SupportedOSPlatformVersion 16.4 cannot be higher than TargetPlatformVersion 16.1)
I've tried uninstalling and reinstalling all the workloads dotnet workload uninstall ios
and dotnet workload install ios
I've deleted the bin & obj directories
Finally, I've tried creating a new maui project, which works, so I've incrementally added all the libraries the not-working project uses and it still works... WHY
I just keep getting the error:
clang++ exited with code 1:
ld:framework not found System
clang: error: linker command failed with exit code 1
Upvotes: 5
Views: 9081
Reputation: 2951
Adding Microsoft.Identity.Client.Extensions.Msal
fixed it.
EVEN THOUGH I WASN'T USING THE LIBRARY??
Upvotes: 7
Reputation: 10088
To begin with, according to [META] Xcode 14.3 Support for Xamarin, .NET 6/7 and MAUI #17561, Xcode 14.3
is not supported, and it is recommended that you use Xcode 14.2
for now. If you have updated to Xcode 14.3
and want to go back to Xcode 14.2
you can download Xcode 14.2
from the downloads page in the Apple Developer Portal.
In addition, the error below means that it's related to Xcode command line tools
.
clang++ exited with code 1:
ld:framework not found System
clang: error: linker command failed with exit code 1
You may open Xcode and go to Xcode->Preferences->Location->Command Line Tools and then select a different one.
Hopefully this clears that up a little bit.
Upvotes: 2