React-native: openssl/opensslv.h' file not found

Created on 27 Mar 2020  ·  21Comments  ·  Source: facebook/react-native

Description

Pods/Headers/Private/Flipper-Folly/folly/portability/OpenSSL.h:26:10: 'openssl/opensslv.h' file not found

React Native version:

React-Natvie: 0.62
OS: macOS 10.15.4

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. npx react-native init Demo
  2. cd Demo / npx react-native run-ios

Expected Results

Xcode build successfully

Snack, code example, screenshot, or link to a repository:

Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
You may provide a screenshot of the application if you think it is relevant to your bug report.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

Needs

Most helpful comment

Finally I found it's Pod config issue, add "${PODS_ROOT}/Headers/Public/OpenSSL_Universal" into Flipper, Flipper-Folly, Flipper-RSocket Targets->Build Setting->Header Search Paths. then rebuild project, this error will disappear 😄 @alloy

All 21 comments

Seems to work fine for me:

~/tmp » npx react-native init Demo
[…]
✔ Downloading template
✔ Copying template
✔ Processing template
✔ Installing CocoaPods dependencies (this may take a few minutes)
~/tmp » cd Demo/
~/t/Demo » npx react-native run-ios
info Found Xcode workspace "Demo.xcworkspace"
info Launching iPhone 11 (iOS 13.4)
info Building (using "xcodebuild -workspace Demo.xcworkspace -configuration Debug -scheme Demo -destination id=B9F2DEA5-13C9-4E2D-B239-69CA094AD1F8")
[…]
info Installing "/Users/eloy/Library/Developer/Xcode/DerivedData/Demo-gqwvjbhezendjvbjuzjpgewonvlm/Build/Products/Debug-iphonesimulator/Demo.app"
info Launching "org.reactjs.native.example.Demo"
success Successfully launched the app on the simulator

Perhaps the CocoaPods installation didn’t work well for you? Can you try the following and then build again?

~/t/Demo » cd ios/
~/t/D/ios » pod install
[…]
Pod installation complete! There are 33 dependencies from the Podfile and 37 total pods installed.

If still not, please run run-ios with the --verbose flag and paste the output.

@alloy

* BUILD FAILED *

The following build commands failed:
CompileC /Users/joe/Library/Developer/Xcode/DerivedData/Demo-dkuvxchlfnnanoctbfchibozyypb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/AsyncPipe.o /Users/joe/Develop/yizhimei/Demo/ios/Pods/Flipper-Folly/folly/io/async/AsyncPipe.cpp
normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Xcode Version 11.4

2202A5DC-A801-4793-AF4E-FA7442DEC811

Alas I can’t do anything without more tangible information. Can you please share an example app that demonstrates the problem and that has all files checked in, including the ios/Pods directory?

+1

I’m going to close this for now, as there is no details for me to work with. Please do follow-up, though, and we can re-open the issue!

I have the same problem!

React-Natvie: 0.62.1
OS: macOS 10.14.6

I created the app with the command
npx react-native init
then I tried launching the app on the simulator with Xcode and getting that problem.

I have also tried using pod install, but it doesn't work.

hi i have the same problem i try to create a project with 0.62.2 but when i try to run in xcode appers this error , i try to install pod install but it doesn't work.

As mentioned before, I can’t do anything without an example app that reproduces the problem, so please help me help you by sharing such an example. 🙏

this is my error when i try to run "react-native run-ios"
fatal error: 'openssl/opensslv.h' file not found

include

     ^~~~~~~~~~~~~~~~~~~~

1 error generated.

+1

  1. upgrade react-native from 0.59 to 0.62.2. ❌
  2. npx react-native init Demo ❌
  3. upgarde Mac OS Catalina 10.15.4 & reinstall Xcode 11.4 ❌
  4. set Flipper-Folly target build settings header search paths library search paths, add libcrypto.a and libssl.a in Link Binary With Libraries, seems to work but causes other problems.
  5. finally I remove Flipper in Podfile and AppDelegate.m

+1

I’m unsubscribing from this issue, as I mentioned what is needed to progress and until then this just adds to my notification load. When somebody posts a reproducing example, please @ mention me 🙏

Creating a project with a slightly older version (0.61.5) worked for me. I've no idea why it worked, but thought i'd mention it in case it helps anyone else :)

npx react-native init AwesomeProject --version 0.61.5

I had the same issue. Could not find openSSL.
Latest Xcode version 11.4.1
Catalina.

SOLVED (for me at least).
I hope this helps everyone.

tldr:

  1. brew update // make sure it's up to date
  2. brew upgrade ruby // this takes a while. we really want to update gems
  3. sudo gem install cocoapods
  4. Restart Xcode
  5. Problem disappeared for me. Built successully.

the long version:
Here was my process. At first I couldn't even get a pod install to work correctly.

I went and 'mv ~/.cocoapods ~/.cocoapods.bak'
Basically I renamed the ./cocoapods directory in your home dir.

Then reran pod install. That worked. Buuuuttttt, when I hit Play in Xcode, the build failed with the openssl issue. For some reason it's not in the path. One option was to go find it and stick it in the build settings search path. hack hack hack. Not feeling that solution...so...

Hunch was somewhere in pod install. Had to go through some arduous process to update pod.

  1. brew update // make sure it's up to date
  2. brew upgrade ruby // this takes a while. we really want to update gems
  3. sudo gem install cocoapods
  4. Restart Xcode
  5. Problem disappeared for me. Built successully.

So basically, you want to upgrade cocoapods to get the latest 'pod' executable. One way top update is with "gems", but that should be updated too, so you do that with updating ruby by using brew, and of course make sure brew is up to date. Egads!

Was not a fan of updating minor versions.

React-Natvie: 0.62.2

when i use brew install coocoapods this error has occurred.

use sudo gem install cocoapods fix this error.

Hope it helps

+1 same issue with Xcode 11.5 macOS 10.15.5 when run
npx react-native run-ios

Finally I found it's Pod config issue, add "${PODS_ROOT}/Headers/Public/OpenSSL_Universal" into Flipper, Flipper-Folly, Flipper-RSocket Targets->Build Setting->Header Search Paths. then rebuild project, this error will disappear 😄 @alloy

Finally I found it's Pod config issue, add "${PODS_ROOT}/Headers/Public/OpenSSL_Universal" into Flipper, Flipper-Folly, Flipper-RSocket Targets->Build Setting->Header Search Paths. then rebuild project, this error will disappear 😄 @alloy

thank you so much it works for me!!!

React-Native: 0.62.2
Xcode: 11.4
OS: macOS Catalina 10.15.5
Pods Version: 1.7.0

👍

Still happening on a fresh install of React native 0.63 via npx react-native init AwesomeProject

Was this page helpful?
0 / 5 - 0 ratings