Skip to content

Commit 088eaef

Browse files
committed
Fix pod install for old version of react native with new arch
1 parent b6c7f6f commit 088eaef

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

react-native-blob-util.podspec

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,27 @@ Pod::Spec.new do |s|
1717
s.framework = 'AssetsLibrary'
1818

1919
if fabric_enabled
20-
install_modules_dependencies(s)
20+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
21+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
22+
if respond_to?(:install_modules_dependencies, true)
23+
install_modules_dependencies(s)
24+
else
25+
# just for backward compatibility: if React Native version <= 0.70.x
26+
s.compiler_flags = "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRCT_NEW_ARCH_ENABLED=1"
27+
s.pod_target_xcconfig = {
28+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
29+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
30+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
31+
}
32+
33+
s.dependency 'React-Core'
34+
s.dependency "React-Codegen"
35+
s.dependency "React-RCTFabric"
36+
s.dependency "RCT-Folly"
37+
s.dependency "RCTRequired"
38+
s.dependency "RCTTypeSafety"
39+
s.dependency "ReactCommon/turbomodule/core"
40+
end
2141
else
2242
s.dependency 'React-Core'
2343
end

0 commit comments

Comments
 (0)