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.

Fix OpenSSL Bug for M1 arm64 Mac support by upgrading Folly dep

See original GitHub issue

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

I believe the latest Folly release has the OpenSSL support needed to get it working on an M1 Mac see this commit https://github.com/facebook/folly/commit/74c66ce23f7da460cbf5106225476d69b76ece0a

React Native version:

Run react-native info in your terminal and copy the results here. 0.63.4

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Pod install
  2. Build Project
  3. Project builds 100%, then throws OpenSSL error

Expected Results

Describe what you expected to happen. Should not throw an OpenSSL error after building

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

3reactions
jocoderscommented, Feb 25, 2021

Have the same problem with React Native app from scratch. Was made a few days ago and was launching with out any troubles until today. Get the error after Xcode build:

/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file ‘/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a’ for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have found the cause of the error: This error indicates that OpenSSL is built containing the simulator slice (x86_64) with the iOS device slice (arm64). Combining device and simulator into a single binary file is not a supported build configuration, and never has been. With the introduction of M1 Macs, where the simulator is also arm64 now, Xcode is looking for a arm64 slice intended for the simulator, but finding one only valid for use on a device, and letting you know of this issue.

The solution is to rebuild OpenSSL. If you intend to use it as a a pre-built binary, rather than compiling from source during your app’s build, it needs to be inside of an XCFramework. XCFrameworks are purposefully designed to separate device and simulator builds into separate files and avoid this class of error.

Guys can you tell me please why OpenSSL is built containing the simulator slice (x86_64) in React Native? And how to rebuild OpenSSL? And how do you solve it in your project?

1reaction
hsavit1commented, Mar 22, 2021

closing this - the problem was resolved by installing the necessary xcode tools

xcode-select --install
Read more comments on GitHub >

github_iconTop Results From Across the Web

Recipe for Building OpenSSL static… | Apple Developer Forums
Anyone know the proper procedure to make a backward compatible version (pre-macOS 10.15) of OpenSSL static library and still support M1 natively?
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
M1 arm64 native OpenSSL with vcpkg - Rhonabwy
After a number of false starts and deeper digging, I found that OpenSSL 1.1.1i included a patch that enabled arm64 macOS compilation. The...
Read more >
Missing Homebrew OpenSSL path check on M1 Macs
Homebrew now installs to /opt/homebrew for macOS on Apple Silicon and ... in which I just ran "brew upgrade openssl" to get OpenSSL...
Read more >
Install older Ruby versions on a M1 MacBook? - Stack Overflow
x works fine on M1 MacBooks using rbenv or asdf . But older versions like 2.7.x and 2.6.x are having various issues. How...
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