react-native-safe-area-context: Got an error on pod install

Hey, I firstly installed the npm package react-native-safe-area-context, then i run the command pod install in the /ios directory. I got this error. Can anyone help me with this issue ?

[!] Unable to find a specification for `RCT-Folly` depended upon by `react-native-safe-area-context`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 19

Most upvoted comments

Specs satisfying the react-native-safe-area-context (from ../node_modules/react-native-safe-area-context) dependency were found, but they required a higher minimum deployment target.

Your Podfile specifies a minimum iOS target of 10.0 but v4 of react-native-safe-area-context requires iOS 11 and above. You can fix this by changing the following line in your Podfile:

platform :ios, '10.0'

to

platform :ios, '11.0'

TL;DR;

If you’re not running a modern version of react-native you’re going to get this error. And you can always check node_modules/react-native/scripts/react_native_pods.rb to see if its specified in your version. Here’s a primitive check:

cat node_modules/react-native/scripts/react_native_pods.rb | grep "/third-party-podspecs/RCT-Folly.podspec"

CC @rafabulsing your version of react-native just isn’t going to work.

Detail

Alright, I was having this issue too. My usecase is that I’m building a react-native library for which I generated the scaffolding via npx create-react-native-library as documented here.

I was then trying to install react-native-safe-area-context in the example app I was getting the same error documented above. So I started doing some digging, and realized that the generated app had react-native@0.63.4 installed which is quite old. I think the technical term is “super-duper old”… and that version doesn’t have the third-party-podspecs library installed.

In my case it looks like the issue is with npx create-react-native-library, not this lib.

Try to use any other version I switched to 3.3.2.

I added a section in the readme to document compatible versions

Sounds like an old dependency is cached. Try removing your Podfile.lock and run pod install again.