iOS: Can't build on physical device

Hey there,

i integrated PDFTron with cocoapods.
I can build the project on the simulator, but not on a real device.
The error message is: “building for iOS, but linking in dylib file built for iOS Simulator for architecture arm64”

What should I do?

Thanks, Chris

Hi Chris,

Thanks for getting in touch.

Could you let us know the CocoaPod podspec link you are using? If you use this link in your Podfile:

do you still see the problem?

Thanks for your reply!
I’m already using this link and getting the error.
I’m on XCode 12.2

It is possible that with older versions of Xcode, you may need to clean the project/workspace when switching from a simulator destination to a device destination. Does cleaning the project/workspace help?

Unfortunately we’re not able to reproduce the linker error on our end, using Xcode version 12.5.

Otherwise, it might be necessary to update Xcode to the latest version, as there have been recent improvements to the XCFramework support in Xcode.