.Net Maui IOS Simulator Build on Mac with M1 Chip

Product: PDFTron.IOS

Product Version: 10.9.0

Please give a brief summary of your issue:

.Net Maui builds fail with “building for iOS Simulator, but linking in dylib built for iOS”

Please describe your issue and provide steps to reproduce it:

  1. Login to a Mac with a M1 chip (ARM64 Architecture)
  2. Create a .Net Maui app using .Net 8 (Just the basic app)
  3. Install PDFtron.IOS and PDFtron.IOS.Tools
  4. Select an emulator to deploy to, I used iPad (10th generation) iOS 17.2
  5. Run the application, the build should fail with the following or similar errors:
    “error : clang++ exited with code 1:”
    "error : ld: building for iOS Simulator, but linking in dylib built for iOS, file ‘[YourMacDestination].nuget/packages/pdftron.ios.tools/10.9.0/lib/net7.0-ios16.1/Tools.resources/Tools.framework/Tools’ for architecture arm64
    "

When I build and deploy to an IOS device (Not a Simulator) it works fine. It seems the packages were not built to support ARM simulators? When can we expect a new build with this rectified if my assumption is correct and is there a workaround for now?

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Thank you for posting the incident to our forum. We will provide you with an update as soon as possible.

1 Like

Thank you for reaching out. This is expected behavior, please use x86 for your simulator, or use a physical device

1 Like

Hi, I have reverted to a real device as I do not have a x86 simulators. I have a mac with a M1 chip ARM architecture. Are you saying this will never be supported?

1 Like

At this time, it is not planned to be supported, but that could be subject to change. Thank you for your understanding at this time.

1 Like

Are you seeing PDFtron.IOS and PDFtron.IOS.Tools for .net8.0? I am only seeing it for .net7.0?

1 Like

Thank you for your response. According to our Engineering Team, the workaround for running on an arm64 Mac is to instruct the project to use a compatible x86_64 simulator. This can be seen in our maui-sample project, here:

In the .csproj file:

<PropertyGroup Condition="$(TargetFramework.Contains('ios'))"> <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">ios-arm64</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == 'iossimulator-arm64'">iossimulator-x64</RuntimeIdentifier> <ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE> </PropertyGroup>

1 Like