react-native-background-fetch: Unable to build app for iOS simulator

Your Environment

  • Plugin version: 4.0.3
  • Platform: iOS
  • OS version: 14.5
  • Device manufacturer / model: Simulator (Macbook Pro - both Intel and M1 CPUs)
  • React Native version (react-native -v): 0.63.4
  • Plugin config

Expected Behavior

App builds for iOS regardless if running on a simulator or a physical device

Actual Behavior

App builds only when building for a physical device

Steps to Reproduce

  1. yarn install
  2. cd ios && pod install
  3. Open Xcode
  4. Select a simulator (see spec above)
  5. Run

Context

Just trying to test my app on an ios simulator

Debug logs

ld: warning: ignoring file ../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/TSBackgroundFetch.xcframework/ios-arm64_armv7/TSBackgroundFetch.framework/TSBackgroundFetch, missing required architecture x86_64 in file ../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/TSBackgroundFetch.xcframework/ios-arm64_armv7/TSBackgroundFetch.framework/TSBackgroundFetch (2 slices)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_TSBackgroundFetch", referenced from:
      objc-class-ref in AppDelegate.o
      objc-class-ref in libRNBackgroundFetch.a(RNBackgroundFetch.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

As mentioned above, there are no problems when performing exactly the same steps but selecting a physical device as the target to run the app on. Archiving a production build obviously also works.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 20 (14 by maintainers)

Most upvoted comments

That’s your problem. In the early days of RN (2016, 2017), manually adding Framework Search Paths used to be part of the Setup Steps.

It’s probably a good idea to re-generate a fresh RN app and migrate your JS code and dependencies into it.