Skip to content

Can't compile initial project for iOS #30922

Closed
@Yadro

Description

@Yadro

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

Activity

ParvinderjitSF

ParvinderjitSF commented on Feb 9, 2021

@ParvinderjitSF
singleton-altman

singleton-altman commented on Feb 10, 2021

@singleton-altman
lauritaipale

lauritaipale commented on Feb 10, 2021

@lauritaipale

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

EricWiener commented on Feb 10, 2021

@EricWiener

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

Yadro

Yadro commented on Feb 10, 2021

@Yadro
Author

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

One more note: you should also remove Podfile.lock before pod install
Just execute pod update

bramski

bramski commented on Feb 10, 2021

@bramski

Ah my favorite. Random build breaks while updating core libraries. I applied @EricWiener 's code to Podfile and then issued a pod update and was successful. DIdn't need to blow away Podfile.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

apperside commented on Feb 11, 2021

@apperside

@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

nikage commented on Feb 12, 2021

@nikage

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

@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

blastering66 commented on Feb 13, 2021

@blastering66
janicduplessis

janicduplessis commented on Feb 14, 2021

@janicduplessis
Contributor

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

Chasty commented on Feb 16, 2021

@Chasty

Someone should fix this issue with npx, I get the same issue evertyme I create a simple app, please admin solve it.

efec89

efec89 commented on Feb 24, 2021

@efec89

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

It worked for me. Thank you.

8 remaining items

apperside

apperside commented on Mar 15, 2021

@apperside

Try the following

cd ios
rm -rf Podfile.lock
pod install
Kaihuang724

Kaihuang724 commented on Apr 16, 2021

@Kaihuang724

I'm running into the same issue as @jonnyberanek . Has anyone figured out a fix?

gulsher7

gulsher7 commented on May 18, 2021

@gulsher7

by mistake i open .xcodeproj file instead of .xcworkspace.

ardian-c

ardian-c commented on Jun 11, 2021

@ardian-c

I had this issue recently and the problem was with the outdated cocoapods (1.9) version. Updating to a newer version solved the issue.

sudo gem install cocoapods
madhavisolanki

madhavisolanki commented on Jul 8, 2021

@madhavisolanki

This saved me
pod 'OpenSSL-Universal', '~>1.1.1100'

   use_flipper!({'Flipper-Folly' => '~> 2.6.9','Flipper' => '0.95.0'})
    post_install do |installer|
      flipper_post_install(installer)
    end

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

elmcapp commented on Aug 16, 2021

@elmcapp

For me the fix is just to change the Deployment Info target to iOS 11 or greater

adityasingh773

adityasingh773 commented on Nov 3, 2021

@adityasingh773

For me, the issue was related to older Cocoapods version, updating my cocoapods fixed it
sudo gem install cocoapods

349989153

349989153 commented on Dec 14, 2021

@349989153

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))

This is the EXACT ANSWER

mweststrate

mweststrate commented on Dec 15, 2021

@mweststrate
Contributor

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))

This is the EXACT ANSWER

Will add that as requirement to the podspec itself

locked as resolved and limited conversation to collaborators on Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @melvinmt@madhavisolanki@bramski@mweststrate@janicduplessis

      Issue actions

        Can't compile initial project for iOS · Issue #30922 · facebook/react-native