Troubleshooting

React Native Plugin 3.x > Troubleshooting

iPhone simulator with Apple silicon (M1/M2)

Problem

In some cases, when running the iPhone simulator with an Apple silicon (M1/M2) machine, Xcode throws the following error:

building for iOS Simulator, but linking in dylib built for iOS, file '../TaboolaSDK.framework/TaboolaSDK' for architecture arm64

📘

This issue affects the simulator only - not real devices.

Resolution

To work around this problem, add arm64 to the excluded architectures for both your project and your Podfile.

Step 1: Update your project settings

Using Xcode:

  1. Select the project within the project navigator (top, left).
  2. Select the Build Settings tab (right). Make sure that the All tab (just below) is also selected.
  3. Under Architectures, locate the Excluded Architectures node.
  4. Next to the Debug or Release node, click on the + icon to add a new exclusion:
    • For the key, select Any iOS Simulator SDK.
    • For the value, type in arm64.

📘

Depending on your needs, add an exclusion under Debug or Release - or both.

  1. Scroll down to the Build Options section, and locate the Validate Workspace node.
    • Set the value to Yes.

📘

Depending on your needs, set the value for Debug or Release - or both.

Step 2: Update your Podfile

Navigate to your project's ios directory, and edit your Podfile to include the following:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Additional steps

If the above steps do not resolve the problem, you may need to update your existing pods (a sample script is provided below) - and thenclean and rebuild your project.

rm -rf ~/Library/Developer/Xcode/DerivedData/
pod deintegrate
pod update

🚧

The sample script

  • Removes all build cache from Xcode.
  • Updates all pods across your project.