skip to Main Content

After reading https://reactnative.dev/docs/environment-setup, I created a react-native project using npx react-native init ***.

It was successful, so, I tried to run the project using npx react-native run-ios, and got the below error:

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/loser/Library/Developer/Xcode/DerivedData/test0205-dasunahpjpavelgmslwgmvjhesxy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/loser/Documents/projects/test0205/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

16

Answers


  1. Chosen as BEST ANSWER

    It's because of use_flipper in Podfile for iOS project.

    use_flipper!
    

    So, I was needed to indicate Flipper-Folly version with use_flipper as

    use_flipper!({ 'Flipper-Folly' => '2.3.0' })
    

    It worked perfectly after that change.


  2. From mmemories, it’s necessary to execute pod install command before !

    Login or Signup to reply.
  3. This seems to be an issue in react-native 0.63, try initiating the project with –version 0.62 and it should work until they fix the bug

    Login or Signup to reply.
  4. React version -0. 63
    I am still facing the same issue while starting a new project for iOS in Mac. I have followed these steps given below but still the issue

    npx react-native init xxxx
    cd xxxx
    npx react-native run-ios
    pod install
    

    After doin this I got the following error

    ** BUILD FAILED **
    
    The following build commands failed:
            CompileC /Users/apple/Library/Developer/Xcode/DerivedData/profirst-bbfobfkgbfqalecezvbonnkwcffv/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/apple/profirst/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    (1 failure)
    

    Later I have changed in the pod file
    use_flipper! to use_flipper!({ 'Flipper-Folly' => '2.3.0' }), but I’m still having the same issue.

    Here is a screenshot of the problem

    Login or Signup to reply.
  5. Following Everest Climber answer

    1. In Podfile under ios/ folder

      Change use_flipper! to use_flipper!({ ‘Flipper-Folly’ => ‘2.3.0’ })

    2. cd ios
    3. pod install
    4. pod update
    5. cd .. && npx react-native run-ios (to run the application)

    This worked for me. Hopefully, it works for you too

    Login or Signup to reply.
    1. Replace in ios/Podfile – use_flipper! to use_flipper!({ 'Flipper-Folly' => '2.3.0' })
    2. Exclude ios/Podfile.lock
    3. pod install
    Login or Signup to reply.
  6. I could solve this issue after disabling Flipper in ios/Podfile.

    1. Fix Podfile as shown in below image

    enter image description here

    1. cd ios
    2. delete Pods folder and Podfile.lock
    3. pod install
    4. pod update
    5. cd .. && npx react-native run-ios
    Login or Signup to reply.
  7. For me disabling flipper from Podfile works!!

    updated Podfile

    require_relative '../node_modules/react-native/scripts/react_native_pods'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    
    platform :ios, '10.0'
    
    target 'ReactNativeApp' do
      config = use_native_modules!
    
      use_react_native!(:path => config["reactNativePath"])
    
      target 'ReactNativeAppTests' do
        inherit! :complete
        # Pods for testing
      end
    
      # Enables Flipper.
      #
      # Note that if you have use_frameworks! enabled, Flipper will not work and
      # you should disable these next few lines.
      # use_flipper!({ 'Flipper-Folly' => '2.3.0' })
      # post_install do |installer|
        # flipper_post_install(installer)
      # end
    end
    
    target 'ReactNativeApp-tvOS' do
      # Pods for ReactNativeApp-tvOS
    
      target 'ReactNativeApp-tvOSTests' do
        inherit! :search_paths
        # Pods for testing
      end
    end
    
    • cd ios && pod install
    • cd .. && npx react-native run-ios
    Login or Signup to reply.
  8. Yes, Everest Climber is right. It’s broken after I updated my react-native-CLI. It’s because of the use_flipper new version.

    Steps to fix it:

    > Open Podfile for the iOS project.
    > Replace `use_flipper!` with `use_flipper!({ 'Flipper-Folly' => '2.3.0' })`.
    > Then you must remove both Pods directory and Podfile.lock.
    > open terminal and go to iOS project directory.
    > Do `pod install`.
    

    It’s worked for me perfectly.

    Login or Signup to reply.
  9. How to fix:

    This is caused by Flipper-Folly being broken on the latest Catalina build.
    Until this gets patched, your best bet is to force your cocoapods to the latest working version (2.3.0).

    1. Go to your project folder root and open the /ios directory.

      cd ios
      
    2. Open your Podfile and change the following block of code:

      use_flipper!
      

      to

      use_flipper!({ 'Flipper-Folly' => '2.3.0' })
      
    3. Inside the /ios directory run the following command:

      pod install
      
    4. If it worked, go back to your project root and try to run the project

      cd ..
      npx react-native run-ios
      

      in case it didn’t, check the Compatibility trouble-shooting section:

    Compatibility trouble-shooting

    After trying to run pod install you may have gotten a similar error to this:

    [!] CocoaPods could not find compatible versions for pod "Flipper-Folly":
      In Podfile:
        Flipper-Folly (= 2.3.0)
    
        Flipper-RSocket (~> 1.1) was resolved to 1.3.0, which depends on
          Flipper-Folly (~> 2.5)
    
        FlipperKit/FBCxxFollyDynamicConvert (~> 0.54.0) was resolved to 0.54.0,
          which depends on
          Flipper-Folly (~> 2.2)
    

    In order to solve this

    1. Go back to your /ios folder

      cd ios
      
    2. And remove the Podfile.lock file

      rm -rf Podfile.lock
      
    3. Install the pods again

      pod install
      
    4. And run react-native

      cd ..
      npx react-native run-ios
      
    Login or Signup to reply.
  10. If nothing works, comment it.

    # use_flipper!({ 'Flipper-Folly' => '2.5.1' })
    
    Login or Signup to reply.
  11. I tried everything here and a lot more and nothing worked!

    I then:

    • deleted my node_modules (the only thing I hadn’t done yet),
    • deleted Pods folder and Podfile.lock,
    • then npm install (with --legacy-peer-deps for me),
    • npx pod-install (or cd ios/, pod-install)
    • npx react-native run-ios

    And it finally worked.

    Apparently deleting the node_modules did the trick, but do not ask me why.

    Login or Signup to reply.
  12. This issue is caused by flipper-folly pod spec updates

    Remove/uninstall react-native-cli, just use npx

    Try this on react-native 0.63.4 (previous stable version).

    Remember it doesn’t work for latest 0.64.0 with XCode 12.5

    Inside ios/Podfile replace use_flipper! with:

    use_flipper!({ ‘Flipper-Folly’ => ‘2.5.3’, ‘Flipper’ => ‘0.87.0’,’Flipper-RSocket’ => ‘1.3.1’ })

    pod install –repo-update

    npx react-native run-ios

    if you don’t need to use flipper or still getting some issues try commenting out flipper inside podfile and install pods using command

    pod install –repo-update

    #use_flipper!()
      #post_install do |installer|
        #flipper_post_install(installer)
      #end
    
    Login or Signup to reply.
  13. you can easily comment out these lines to disable flipper :

      # add_flipper_pods!
      # post_install do |installer|
      #   flipper_post_install(installer)
      # end
    

    and comment out this lines in appDelegate.m :

    //#if DEBUG
    //#import <FlipperKit/FlipperClient.h>
    //#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
    //#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
    //#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
    //#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
    //#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
    
    //static void InitializeFlipper(UIApplication *application) {
    //  FlipperClient *client = [FlipperClient sharedClient];
    //  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
    //  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
    //  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
    //  [client addPlugin:[FlipperKitReactPlugin new]];
    //  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
    //  [client start];
    //}
    //#endif
    

    also this in the same file:

    //  #if DEBUG
    //  InitializeFlipper(application);
    //  #endif
    
    Login or Signup to reply.
  14. The only fix worked for me

    There is no need to disable flipper or juggle with its versions

    add this to your Podfile in post_install section

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

    it will look like this

      ...
    
      use_flipper!()
    
      post_install do |installer|
        react_native_post_install(installer)
    
        # check if file system is case sensitive 
        # if so then create symbolic links
        # for every openssl framework with name in lowercase
        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
    
        __apply_Xcode_12_5_M1_post_install_workaround(installer)
      end
    
      ...
    

    then

    • remove Pods folder and Podfile.lock

    • run pod install

    • build your app (npx react-native run-ios in the root folder of your app)

    Explanation

    In my case the issue was the case sensitive file system. You can search in terminal for fatal error: 'openssl/opensslv.h' file not found or just try to build using this fix.

    Login or Signup to reply.
  15. use_flipper!({ 'Flipper' => '0.145.0' })
    

    use this in pod file. worked for me…

    delete the podfile.lock then run,

    pod install
    pod update
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search