'clang++ exited with code 1' iOS build issue
NickD-Callaway opened this issue · 10 comments
Description
Hello!
I am currently running into a build issue with MAUI onto the iOS platform. This issue only occurs after I import the Azure.Identity library. I brought this up with the Azure team here Azure/azure-sdk-for-net#30156 and they suggested I bring this up to you!
Steps to Reproduce
- Create a new default MAUI project
- Import the Azure.Identity 1.6.0 library
- Make sure you are paired to a Mac device
- Switch the Build Device to an iOS simulator or Remote Device
- Run the project on simulator or remote device
- The error will happen in the build process
I attached an example project here: MauiAzureTest.zip
Version with bug
6.0.408 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15+
Did you find any workaround?
No workaround yet.
Relevant log output
1>--skip-unresolved true --custom-data "LinkerOptionsFile=obj/Debug/net6.0-ios/iossimulator-x64/custom-linker-options.txt" --custom-data DisableMarkingOfCopyAssemblies=true --verbose -b --disable-opt unusedtypechecks --feature ObjCRuntime.Runtime.Arch.IsSimulator true
1>Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
1>Tool xcrun execution finished (exit code = 1).
1>ld: framework not found System
1>clang: error: linker command failed with exit code 1 (use -v to see invocation)
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.430\targets\Xamarin.Shared.Sdk.targets(1219,3): error : clang++ exited with code 1
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.430\targets\Xamarin.Shared.Sdk.targets(1219,3): error :
1>Done building project "MauiAzureTest.csproj" -- FAILED.
@rolfbjarne this seems more something in your area? I think we need to get to the root cause of that clang error but I'm not really sure how to actually get more info was that -v -v -v -v in the addtional mtouch arguments?
I think this is related to Microsoft.Identity.Client issue that does not build on MAUI:
AzureAD/microsoft-authentication-library-for-dotnet#3127
@fabio-popup I don't have that (Not an Azure project), and yet I've hit this issue multiple times.
I am getting the same error. Today I updated to 17.4.0 Preview 1.0. Suddenly the error I was having connecting to my Mac was gone, seemed at first to work great. The new WAS worked Windows, my connected Android device but the clang++ exited with code 1 shows up during compile???
Please get a binary build log (https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#binary-build-logs) and I'll have a look to try to see what's happening.
I attached a binlog inside the ZIP for you to diagnose. If you need anything else let me know!
MauiAzureTest_Debug_AnyCPU_net6.0-ios_Build_2022-08-17T10_24_49.1219366-05_00.zip
This is the problem: AzureAD/microsoft-authentication-extensions-for-dotnet#180
Seems like this is out of our hands then. Thank you for the help here!
I tried with 3 different versions of Microsoft.Identity.Client package today and and found that Version 4.46.2 is giving clang++ error in iOS while building the app. However, the latest version (4.47.0), recently launched, and 4.46.0-preview2 versions works well in Android and iOS both platforms and gives me the Access Token after B2C login.
https://www.nuget.org/packages/Microsoft.Identity.Client/4.47.0
Microsoft.Identity.Client version 4.47.0 works! in my case one of the project under solution was pointing to old version