question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build app for iOS simulator

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
christocracycommented, Oct 6, 2021

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.

0reactions
jnurkkacommented, Oct 6, 2021

How long ago was your RN app generated from react-native init?

Around 4 years ago 🤷‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build to simulator on Apple … | Apple Developer Forums
Using Xcode 12.2, the specific error is "building for iOS Simulator, but linking in object file built for iOS, file '.
Read more >
Not able to build and run flutter app in IOS simulator
Not able to build and run any flutter app on iOS simulator using the command flutter run, it shows the error code as...
Read more >
Unable to deploy to iOS simulator - Microsoft Q&A
First I am a complete newbie to Xamarin. I inherited a project, and have learned enough to get around on the Android side....
Read more >
Steps to resolve failed to build iOS app error - YouTube
45,6s Failed to build iOS app Error output from Xcode build : ↳ ** BUILD FAILED ** Could not build the application for...
Read more >
How to fix Could not build the application for the simulator ...
Clean the build cache. This will takes a little more time to build/run later. ... If there are still errors you can try...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found