Closed
Description
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
- npx react-native init bestproject
- cd bestproject
- pod install
- Run project in xcode
- Receive the errors
Activity
ParvinderjitSF commentedon Feb 9, 2021
singleton-altman commentedon Feb 10, 2021
lauritaipale commentedon 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.EricWiener commentedon Feb 10, 2021
In case anyone else is wondering how to do this, you need to add
pod 'OpenSSL-Universal', '~>1.0.2.20'
to your PodfileYadro commentedon Feb 10, 2021
One more note: you should also removePodfile.lock
beforepod install
Just execute
pod update
bramski commentedon Feb 10, 2021
Ah my favorite. Random build breaks while updating core libraries. I applied @EricWiener 's code to
Podfile
and then issued apod update
and was successful. DIdn't need to blow awayPodfile.lock
as @Yadro was suggesting.Mostly commenting to get my name on here and get an update when this issue is fixed so I can unpin
OpenSSL-Universal
.apperside commentedon Feb 11, 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
nikage commentedon Feb 12, 2021
@aparedes this worked form me. I'm new to both react native and ios development. It's quite confusing to face such problems while running a helloWorldApp.
blastering66 commentedon Feb 13, 2021
janicduplessis commentedon Feb 14, 2021
Updating cocoapods to 1.10.1 fixed the issue.
There seems to be an issue with xcframeworks on version 1.9.x (krzyzanowskim/OpenSSL#113 (comment))
Chasty commentedon Feb 16, 2021
Someone should fix this issue with npx, I get the same issue evertyme I create a simple app, please admin solve it.
efec89 commentedon Feb 24, 2021
It worked for me. Thank you.
Working ios build by updating Cocoapod deps
8 remaining items
apperside commentedon Mar 15, 2021
Try the following
Kaihuang724 commentedon Apr 16, 2021
I'm running into the same issue as @jonnyberanek . Has anyone figured out a fix?
gulsher7 commentedon May 18, 2021
by mistake i open .xcodeproj file instead of .xcworkspace.
ardian-c commentedon Jun 11, 2021
I had this issue recently and the problem was with the outdated cocoapods (1.9) version. Updating to a newer version solved the issue.
madhavisolanki commentedon Jul 8, 2021
This saved me
pod 'OpenSSL-Universal', '~>1.1.1100'
I am also using googleplaces and google maps so I had to add this
installer.pods_project.targets.each do |target| if target.name == 'react-native-google-places' target.build_configurations.each do |config| config.build_settings['CLANG_ENABLE_MODULES'] = 'No' end end if target.name == "React" target.remove_from_project end end
and
pod 'react-native-google-places', :path => '../node_modules/react-native-google-places'
Adding to help someone with similar issue. After switching to Big Sur and Xcode 12.5
Later I had this issue while generating a device build ___cxa_increment_exception_refcount"
so I had to make these changes
pod 'OpenSSL-Universal', '~>1.1.180'
use_flipper!({'Flipper' => '0.92.0', 'Flipper-Folly' => '2.6.7'})
elmcapp commentedon Aug 16, 2021
For me the fix is just to change the Deployment Info target to iOS 11 or greater
adityasingh773 commentedon Nov 3, 2021
For me, the issue was related to older Cocoapods version, updating my cocoapods fixed it
sudo gem install cocoapods
349989153 commentedon Dec 14, 2021
This is the EXACT ANSWER
mweststrate commentedon Dec 15, 2021
Will add that as requirement to the podspec itself
Add constraint on supported cocoapods version