facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.27k stars 24.35k forks source link

openssl/opensslv.h' file not found #28409

Closed DaiYz closed 4 years ago

DaiYz commented 4 years ago

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

2meeltd commented 3 years ago

Where your build file system is not the same as /Users, use just pods as the test case!

post_install do |installer|
  flipper_post_install(installer)

  # The real directory is /Users/<user>/Library.
  # In case-sensitive file systems the file won't exists.
  unless File.exist? "pods"
    system('cd Pods/Headers/Public; ln -s Protobuf protobuf')
    system('cd Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s; ln -sfh OpenSSL.framework openssl.framework')
    system('cd Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_i386_x86_64-simulator; ln -sfh OpenSSL.framework openssl.framework')
    system('cd Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_x86_64-maccatalyst; ln -sfh OpenSSL.framework openssl.framework')
    system('cd Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/macos-arm64_arm64e_x86_64; ln -sfh OpenSSL.framework openssl.framework')
  end
end