Share via

MAUI: iOS Build Issues in Visual Studio Code

Sreenivasan, Sreejith 740 Reputation points
2026-03-12T12:40:13.1733333+00:00

I am getting below error when running the MAUI app on mac visual studio code:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : clang++ exited with code 1: [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : Undefined symbols for architecture arm64: [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error :   "_swift_FORCE_LOAD$_swiftCompatibility56", referenced from: [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error :       _swift_FORCE_LOAD$swiftCompatibility56$_FirebaseAnalytics in FirebaseAnalytics[arm64]17 [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error :   "_swift_FORCE_LOAD$_swiftCompatibilityConcurrency", referenced from: [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error :       _swift_FORCE_LOAD$swiftCompatibilityConcurrency$_FirebaseAnalytics in FirebaseAnalytics[arm64]17 [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : ld: symbol(s) not found for architecture arm64 [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8319/targets/Xamarin.Shared.Sdk.targets(1648,3): error : clang++: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/sreejith.sreenivasan/Downloads/inv-hnas337-mobile-patient/Inventiva/Inventiva.csproj::TargetFramework=net8.0-ios]     2869 Warning(s)     1 Error(s)   Time Elapsed 00:01:15.59

My Xcode version:

xcodebuild -version

Xcode 16.4

Build version 16F6

Dotnet version:

Version: 8.0.412

Workload details:

maui-ios 8.0.100/8.0.100 SDK 8.0.400

maui 8.0.100/8.0.100 SDK 8.0.400

In my MAUI project I have added .NET class library and .NET MAUI class library project. I have alsi added a global.json to force use .NET 8 like below.

{ 
	"sdk": 
	{ 
		"version": "8.0.412" 
	} 
}

To fix the error I have added a PropertyGroup like below on my MAUI project .csproj.

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
        <MtouchLink>SdkOnly</MtouchLink>
        <_EnableSwiftSupport>true</_EnableSwiftSupport>
    </PropertyGroup>

None of them resolves the issue, please suggest the correct solution.

Developer technologies | .NET | .NET MAUI
0 comments No comments

Answer accepted by question author
  1. Nancy Vo (WICLOUD CORPORATION) 1,985 Reputation points Microsoft External Staff Moderator
    2026-03-13T10:19:11.33+00:00

    Hi @Sreenivasan, Sreejith ,

    Thank you for reaching out.

    From the log you shared, your app is trying to build for iOS, but the builder can't find some special helper pieces that FirebaseAnalytics needs. On a normal Xcode project, Apple automatically puts those helpers in the right drawer. But in MAUI's build system (especially on .NET 8), the drawer is hidden.

    I recommend these solutions below:

    • It's better to upgrade the MAUI version. Since .NET MAUI 8 is now older, it may not support many features that newer versions provide (long-term recommendation).
    • Add this example code to your .csprj FILE. Put it inside the <Project> tag, maybe right after your other <PropertyGroup> sections.
    <Target Name="LinkWithSwift" DependsOnTargets="_ParseBundlerArguments;_DetectSdkLocations" BeforeTargets="_LinkNativeExecutable">
      <PropertyGroup>
        <_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iphonesimulator</_SwiftPlatform>
        <_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('ios-'))">iphoneos</_SwiftPlatform>
      </PropertyGroup>
      <ItemGroup>
        <_CustomLinkFlags Include="-L" />
        <_CustomLinkFlags Include="/usr/lib/swift" />
        <_CustomLinkFlags Include="-L" />
        <_CustomLinkFlags Include="$(_SdkDevPath)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(_SwiftPlatform)" />
      </ItemGroup>
    </Target>
    

    Then clean and rebuild your project.

    Hope this helps. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance provide feedback. Thank you.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.