NPRKF
NPRKF

Reputation: 1

Undefined Symbols for Architecture arm64 When Migrating Xamarin iOS Binding Library to .NET MAUI 8.0

I'm encountering an issue while migrating a Xamarin framework to .NET MAUI 8.0. Although I’m not an experienced .NET developer, I’m hoping to get some guidance from the community.

I’m using JetBrains Rider to create the necessary files for the binding library, including ApiDefinitions.cs and StructsAndEnums.cs. I’ve added the .xcframework folder under the libraries and successfully compiled it, which produced a .dll file.

However, when I build a simple test MAUI app for iOS, I encounter the following error during build time:

Xamarin.Shared.Sdk.targets(1648,3): Error : clang++ exited with code 1:

Undefined symbols for architecture arm64:

"_OBJC_CLASS_$_ACTION", referenced from:

<initial-undefines>

There are a few more mentions of undefined symbols in the error log.

Here is the configuration of my .csproj file:


<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net8.0-ios</TargetFramework>
        <ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
        <OutputType>Library</OutputType>
        <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
        <EnableDefaultItems>false</EnableDefaultItems>
        <ObjcBindingMode>Native</ObjcBindingMode>
        <BindingProjectType>Native</BindingProjectType>
        <IncludeSymbols>true</IncludeSymbols>
        <IncludeNativeSymbols>true</IncludeNativeSymbols>
        <Nullable>enable</Nullable>
        <ImplicitUsings>true</ImplicitUsings>
        <IsBindingProject>true</IsBindingProject>
    </PropertyGroup>
    <PropertyGroup>
      <SupportedArchitectures>arm64;x86_64</SupportedArchitectures>
    </PropertyGroup>

    <ItemGroup>
        <ObjcBindingApiDefinition Include="ApiDefinition.cs"/>
        <ObjcBindingCoreSource Include="StructsAndEnums.cs"/>
    </ItemGroup>

    <ItemGroup>
      <Folder Include="Frameworks\" />
    </ItemGroup>

    <ItemGroup>
      <NativeReference Include="Frameworks/CustomFramework.xcframework">
        <Kind>Framework</Kind>
        <SmartLink>false</SmartLink>
        <ForceLoad>true</ForceLoad>
        <LinkerFlags>-ObjC</LinkerFlags>
      </NativeReference>
  </ItemGroup>

</Project>

Has anyone experienced anything like this before or can point me in the right direction to what may be causing the errors?

Upvotes: 0

Views: 60

Answers (0)

Related Questions