I faced the same problem with RCT-Folly
and solved the issue following the ways below:
Basically, it comes from ../node_modules/react-native/scripts/react_native_pods.rb
file. Here is the code of that file.
# But... doing so caused another issue in Flipper:
# "Time.h:52:17: error: typedef redefinition with different types"
# We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
# See https://github.com/facebook/flipper/issues/834 for more details.
time_header = "#{Pod::Config.instance.installation_root.to_s}/Pods/RCT-Folly/folly/portability/Time.h"
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' #{time_header}`
If you edit the code in node_modules
, the .lock
file will be changed. So to be safe, you can update the Podfile
.
Add this line of code
sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h
after the post_install do |installer|
line in Podfile
like the following code snippet
target 'AwesomeProjectTests' 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 the next line.
use_flipper!()
post_install do |installer|
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
Run cd ios
on the project root folder
Run pod deintergrate
in the terminal and install pod again with the command pod install
Finally, build the project again with running the command npx react-native run-ios
on the project root folder
Bingo! My issue has been solved as expected.