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.

Build error on iOS after installing react-native-safe-area-context

See original GitHub issue

Getting this error after installing the library for the first time and trying to build the project on xcode. it worked perfectly on android. I’m using RN 0.59.9

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RNCSafeAreaProvider", referenced from:
      objc-class-ref in libRNCSafeAreaContext.a(RNCSafeAreaView.o)
  "_OBJC_CLASS_$_RNCSafeAreaShadowView", referenced from:
      objc-class-ref in libRNCSafeAreaContext.a(RNCSafeAreaViewManager.o)
  "_OBJC_CLASS_$_RNCSafeAreaViewLocalData", referenced from:
      objc-class-ref in libRNCSafeAreaContext.a(RNCSafeAreaView.o)
  "_UIEdgeInsetsEqualToEdgeInsetsWithThreshold", referenced from:
      -[RNCSafeAreaView invalidateSafeAreaInsets] in libRNCSafeAreaContext.a(RNCSafeAreaView.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SpencerLynncommented, Dec 31, 2020

I also ran into this issue. I am on RN 0.59 (still).

I was able to fix it my manually linking off of the files in the SafeAreaView.xcodeproj in my main Xcode project. I simply selected every Objective-C file inside the node_modules/react-native-safe-area-context/ios/SafeAreaView folder. For some reason it only had two of the files included, when there are many more.

I’m happy to create a pull request if this is a solution desired in the library 😄

1reaction
dnsmobcommented, Dec 19, 2020

bah. it turns out it things have been a bit unstable with other libraries breaking ‘randomly’ too. i ended adding a step in my pipeline to find and replace any dependency React by React-Core and it seems to have improved matters. the command is
$ find ./node_modules -name \*.podspec -exec sed -i '' "s/s.dependency.*['\"]React[\"']/s.dependency 'React-Core'/g" {} \; HTH

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-safe-area-context - npm
Start using react-native-safe-area-context in your project by running `npm ... JavaScript tests iOS build Android build ... npx pod-install ...
Read more >
react-native-safe-area-context throw ... - Stack Overflow
Short Solution: If you use ReactNative <= 0.63, install react-native-safe-area-context in V3 (e.g 3.4.1), as it's not compatible with v4 of ...
Read more >
react-native-safe-area-context could not be found within the ...
1 Answer. Sorted by: 1. If you are using Yarn, try to: Remove the package with yarn remove. Reset the cache with yarn...
Read more >
How to fix “RNCSafeAreaProvider” was not found in ... - Medium
1.) Uninstall the app. ... 3.) npx react-native run-android to build the app again. The “RNCSafeAreaProvider” was not found in the UIManager Error...
Read more >
Getting Started - React Native Elements
This will throw an error though it won't prevent the application from running. To fix this you'll simply have to run react-native unlink...
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