[Bug] iOS Build error after updating the MSAL version
Library version used
4.74.1
.NET version
After updating MSAL from 4.68.0 to 4.74.1 I get a build error for iOS.
<PackageVersion Include="Microsoft.Identity.Client.Broker" Version="4.74.1" />
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.74.1" />
Scenario
PublicClient - mobile app
Is this a new or an existing app?
The app is in production, and I have upgraded to a new version of MSAL
Issue description and reproduction steps
I have updated MSAL with this commit:
- https://github.com/jbe2277/waf/commit/3bb8eef33f139e551963327c032ce145be39a7b2
The GitHub action to build the iOS version failed:
- https://github.com/jbe2277/waf/actions/runs/16915677863/job/47934812330
with the error message:
/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.5/18.5.9215/targets/Xamarin.Shared.Sdk.targets(1837,3):
error : clang++ exited with code 1: [/Users/runner/work/waf/waf/src/NewsReader/NewsReader.MauiSystem/
NewsReader.MauiSystem.csproj::TargetFramework=net9.0-ios]
/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.5/18.5.9215/targets/Xamarin.Shared.Sdk.targets(1837,3):
error : ld: building for 'iOS-simulator', but linking in dylib (/Users/runner/work/waf/waf/src/NewsReader/
NewsReader.MauiSystem/obj/Release/net9.0-ios/iossimulator-arm64/nativelibraries/Contents/MonoBundle/
msalruntime_arm64.dylib) built for 'macOS' [/Users/runner/work/waf/waf/src/NewsReader/NewsReader.MauiSystem/
NewsReader.MauiSystem.csproj::TargetFramework=net9.0-ios]
/Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.5/18.5.9215/targets/Xamarin.Shared.Sdk.targets(1837,3):
error : clang++: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/runner/work/waf/waf/src/
NewsReader/NewsReader.MauiSystem/NewsReader.MauiSystem.csproj::TargetFramework=net9.0-ios]
Relevant code snippets
Expected behavior
No response
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
4.68.0
Solution and workarounds
No response
We encountered a similar issue when building the iOS release version, with the following error message:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.4/18.4.9289/targets/Xamarin.Shared.Sdk.targets(1652,3): error : ld: building for 'iOS', but linking in dylib (/Users/mobileframework/Documents/Build/Source/MAUI/Ifs.Maui/obj/Release/net9.0-ios/ios-arm64/nativelibraries/Contents/MonoBundle/msalruntime_arm64.dylib) built for 'macOS'
This error occurs when using Microsoft.Identity.Client v4.76.0, but does not occur with older versions such as v4.72.1.
I believe this is a similar case to #5407 The same cleanup approach should work here as well.