Skip to content

Commit 7dcb024

Browse files
authored
fix: exclude RCT-Folly from prebuilt RN (#3447)
## 🎯 Goal This PR fixes iOS Pod install failures when using prebuilt React Native dependencies/core by conditionally excluding RCT-Folly from `stream-chat-react-native.podspec`. In New Architecture builds when prebuilt React Native modes are enabled, the SDK still declared a direct dependency on `RCT-Folly`. In certain configurations (for example RN 0.80 with `RCT_USE_RN_DEP=1`), this can cause `pod` installation to fail with: ``` - [!] Unable to find a specification for 'RCT-Folly' depended upon by 'stream-chat-react-native' ``` This fails in prebuilt mode because React Native no longer relies on resolving `RCT-Folly` as a standalone pod from the specs repo. Instead, `Folly` is handled through RN’s prebuilt dependency/core packaging. As a result, an explicit `s.dependency "RCT-Folly"` in our `podspec` can force cocoapods to resolve a podspec that is not available in that installation path, causing the failure. Should resolve [this github issue](#3369). ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent 630bd8a commit 7dcb024

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

package/native-package/stream-chat-react-native.podspec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ Pod::Spec.new do |s|
2828
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
2929
}
3030
s.dependency "React-Codegen"
31-
s.dependency "RCT-Folly"
31+
# Prebuilt RN modes already handle Folly (or don't expose RCT-Folly podspec).
32+
use_prebuilt_core = ENV['RCT_USE_PREBUILT_RNCORE'] == '1'
33+
use_prebuilt_deps = ENV['RCT_USE_RN_DEP'] == '1'
34+
unless use_prebuilt_core || use_prebuilt_deps
35+
s.dependency "RCT-Folly"
36+
end
3237
s.dependency "RCTRequired"
3338
s.dependency "RCTTypeSafety"
3439
s.dependency "ReactCommon/turbomodule/core"
3540
install_modules_dependencies(s)
3641
end
3742
end
38-

0 commit comments

Comments
 (0)