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.

Can't compile initial project for iOS

See original GitHub issue

Description

When I create a new project via npx react-native init bestproject and trying to compile it on macOS I receive the following errors:

/Users/user/projects/bestproject/ios/Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bn.h:186:39:
 Unknown type name 'BN_ULONG'
Flipper-Folly
/Users/user/projects/bestproject/ios/Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/openssl.framework/Headers/bio.h:687:1:
 Expected function body after function declarator

React Native version:

System:
    OS: macOS 10.15.7
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 433.12 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.10.1 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.10 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.3/12C33 - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

  1. npx react-native init bestproject
  2. cd bestproject
  3. pod install
  4. Run project in xcode
  5. Receive the errors

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:26 (2 by maintainers)

github_iconTop GitHub Comments

42reactions
EricWienercommented, Feb 10, 2021

Building existing iOS projects also start failing with the same error(s) if OpenSSL-Universal gets updated to 1.1.180 via pod update. Rolling back to OpenSSL-Universal 1.0.2.20 (Flipper-Folly 2.3.0 and Flipper-RSocket 1.1.0) seems to get the iOS build working again.

In case anyone else is wondering how to do this, you need to add pod 'OpenSSL-Universal', '~>1.0.2.20' to your Podfile

21reactions
appersidecommented, Feb 13, 2021

@lauritaipale’s solution worked for me, adding this to my pod file fixed the problem:

pod ‘OpenSSL-Universal’, ‘~>1.0.2.20’

NOTE: after adding this, just running pod install will fire an error due to versions mismatch, in that case remove Podfile.lock and pod install again

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode can't build a project | Apple Developer Forums
Hello, project works fine in Xcode 12.5. 1, but when I open it in 13.1 to test, I get error when hitting build....
Read more >
Why Won't My Xcode Project Build? - Swift Dev Journal
The first step to figuring out why your project won't build is to find the compiler errors in your project. Open Xcode's issue...
Read more >
xcode - iOS project won't compile, just stalls with no error ...
I had to pull out my CoreData model from XCode and reincorporate it back into my project. It seems arbitrary, but I've been...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
If your native toolchains are installed correctly and you are unable to build and run your project in release mode on your local...
Read more >
iOS - PyTorch
Open your project in XCode, go to your project Target's Build Phases - Link Binaries With Libraries , click the + sign and...
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