flipper icon indicating copy to clipboard operation
flipper copied to clipboard

Getting iOS Build issue

Open ShahululFaris opened this issue 2 years ago • 11 comments

🐛 Bug Report

Getting issue while build project on iOS. This errors by removing Flipper. If Flipper updated in pod file the same issue getting but it shows Flipper-Folly instead of RCT-Folly in folder structure of error. Showing Recent Errors Only /Users/shahululfarisp/Downloads/atlantis-pa-fe/ios/Pods/Headers/Public/RCT-Folly/folly/Utility.h:327:12: No template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?

Showing Recent Errors Only /Users/shahululfarisp/Downloads/atlantis-pa-fe/ios/Pods/Headers/Public/RCT-Folly/folly/Optional.h:264:20: Functions that differ only in their return type cannot be overloaded

Showing Recent Errors Only /Users/shahululfarisp/Downloads/atlantis-pa-fe/ios/Pods/Headers/Public/RCT-Folly/folly/Range.h:527:12: No template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?

To Reproduce

Just build the project on X code 14.2 or X code 13.4

Environment

react native: 0.63.0 Node: 14.17.3 XCode 14.2 or 13.4 ios BUild

ShahululFaris avatar Jan 31 '23 06:01 ShahululFaris

I got the same error when I upgraded from v0.66.4 to 0.69.12 :cry:

hvlong avatar Oct 06 '23 09:10 hvlong

Any updates on this? Did anyone solve the issue?

I have the same issue.

mclbdn avatar Feb 29 '24 08:02 mclbdn

Any updates on this issue

deepas96 avatar Mar 21 '24 13:03 deepas96

Seeing the same issue on React Native 0.72.6. Has there been any resolution here?

airowe avatar Mar 21 '24 23:03 airowe

+1

amjadbouhouch avatar Mar 27 '24 07:03 amjadbouhouch

+1

ehsan6sha avatar Apr 01 '24 17:04 ehsan6sha

+1

VasylMartyniv avatar Apr 01 '24 18:04 VasylMartyniv

This works for me, I added in the Podfile those 3 fixes as post_install.

def __apply_Xcode_15_post_install_workaround(installer)
    # This is a workaround for Xcode 15, see: https://github.com/facebook/react-native/issues/37748.
    puts "Applying Xcode 15 post install workaround"
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
      end
    end
  end

  def __apply_Xcode_15_Flipper_post_install_workaround(installer)
    puts "Applying Xcode 15 Flipper fix."
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end 
    end
  end
  
  def __apply_Xcode_15_commonFixes_post_install(installer)
    # This is common issues
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
      end
    end
  end

  # See https://github.com/facebook/react-native/issues/37748#issuecomment-1580589448
  post_install do |installer|
      __apply_Xcode_15_post_install_workaround(installer)
      __apply_Xcode_15_Flipper_post_install_workaround(installer)
      __apply_Xcode_15_commonFixes_post_install(installer)
      
  end

amjadbouhouch avatar Apr 01 '24 23:04 amjadbouhouch

Had a similar issue with RN 0.72.6. Updating to 0.72.12 fixed it.

friederbluemle avatar Apr 13 '24 01:04 friederbluemle

Had a similar issue with RN 0.72.6. Updating to 0.72.12 fixed it.

Thank you sir! This upgrade helped me! Currently using below versions on system...

==ENV CHECKER==
=====Ruby======
ruby 3.3.1 (2024-04-23 revision c56cd86388) [arm64-darwin23]
===Cocoapods===
1.15.2
====Bundler====
Bundler version 2.5.9 (2024-05-06 commit unknown)
=====Java======
openjdk 17.0.10 2024-01-16
OpenJDK Runtime Environment Homebrew (build 17.0.10+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.10+0, mixed mode, sharing)
=====Node======
v20.9.0
=====Yarn======
1.22.21
=====XCode=====
Xcode 15.3
Build version 15E204a
=====MacOS=====
ProductName:		macOS
ProductVersion:		14.4.1
BuildVersion:		23E224

Gabao-Farias avatar May 06 '24 02:05 Gabao-Farias