Skip to content

Upgrading from .NET 9.0 to .NET 10.0 leads to linker issues when using xcframeworks with long paths #24564

@ewerspej

Description

@ewerspej

Apple platform

iOS

Framework version

net10.0-*

Affected platform version

VS 2026, .NET SDK 10.0.102, Xcode 26.2 and .NET for iOS (26.2.10191)

Description

Originally posted this issue in TobiasBuchholz/Plugin.Firebase#565

It appears that there is a breaking change between .NET 9.0 and .NET 10.0

After upgrading an existing project from .NET 9.0 to .NET 10.0, I'm getting the following linker errors when I try to use Plugin.Firebase (bundle) or Plugin.Firebase.Crashlytics together with Plugin.Firebase.Analytics with .NET SDK 10.0.102, Xcode 26.2 and .NET for iOS (26.2.10191):

1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error : clang++ exited with code 1:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error : Undefined symbols for architecture arm64:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :   "_FIRConsentStatusDenied", referenced from:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :       <initial-undefines>
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :   "_FIRConsentStatusGranted", referenced from:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :       <initial-undefines>
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :   "_FIRConsentTypeAdStorage", referenced from:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :       <initial-undefines>
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :   "_FIRConsentTypeAnalyticsStorage", referenced from:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :       <initial-undefines>
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :   "_OBJC_CLASS_$_FIRAnalytics", referenced from:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error :        in registrar.o
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error : ld: symbol(s) not found for architecture arm64
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net10.0_26.2\26.2.10191\targets\Xamarin.Shared.Sdk.targets(1864,3): error : clang++: error: linker command failed with exit code 1 (use -v to see invocation)

These errors do not occur when using any of the other packages separately (with all required transient/base libraries) in different projects, so far I've only encountered this with the above mentioned packages.

I'm using Visual Studio 2026 on Windows 11 paired to a Mac (Apple M2) running macOS Tahoe (26.2) and XCode 26.2.

I've tried including the transient packages directly using the most recent versions and I've also tried excluding the frameworks from being trimmed and played around with different linker settings, but to no avail.

This affects Debug builds for physical iOS devices as well as iOS simulators without any linking or trimming explicitly enabled:

<!-- iOS Debug -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0-ios' and '$(Configuration)' == 'Debug'">
	<ApplicationId>de.my.app</ApplicationId>
	<CodesignKey>MyCodeSignKey</CodesignKey>
	<CodesignProvision>MyProvisioningProfile</CodesignProvision>
	<ProvisioningType>manual</ProvisioningType>
	<MtouchExtraArgs>$(MtouchExtraArgs) --weak-framework=NewsstandKit</MtouchExtraArgs>
	<CodesignEntitlements>Platforms\iOS\Entitlements.Debug.plist</CodesignEntitlements>
	<MtouchNoSymbolStrip>True</MtouchNoSymbolStrip>
	<EnableBitcode>false</EnableBitcode>
</PropertyGroup>

This issue only occurs when trying to deploy on an iOS device or simulator from Windows. I can successfully build and run the project if I build directly on macOS, e.g. using Rider.

Steps to Reproduce

  1. Take a MAUI project running on .NET 9.0
  2. Configure a Firebase project
  3. Add Plugin.Firebase or Plugin.Firebase.Analytics and follow the necessary setup steps
  4. Make sure to avoid long path issues on Windows by enabling long paths in the OS. restore and first build via CLI (https://developercommunity.visualstudio.com/t/Allow-building-running-and-debugging-a/351628#T-N10888570)
  5. Use Pair-To-Mac to connect to a Mac Build Host
  6. Build and deploy to iOS using Visual Studio Build - it will work
  7. Now upgrade the MAUI project to .NET 10.0
  8. Build via CLI
  9. Try to build and run on iOS again using Visual Studio Build
  10. The linker issues related to missing symbols of iOS bindings will appear

Did you find any workaround?

Build MAUI iOS app directly on Mac

Build logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-projectsIssue or PR that affects binding projectsneed-infoWaiting for more information before the bug can be investigated

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions