react-native: 0.69.4 hermes crashes with use_frameworks! enabled
Description
Using RN 0.69.4 and enabled hermes causes crash.
Able to get it working with Podfile changes, or disabling hermes.
$static_library += [
'React-hermes'
]
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
bt = pod.send(:build_type)
if $static_library.include?(pod.name)
puts "Overriding the build_type to static_library from static_framework for #{pod.name}"
def pod.build_type;
Pod::BuildType.static_library
end
end
end
installer.pod_targets.each do |pod|
bt = pod.send(:build_type)
puts "#{pod.name} (#{bt})"
puts " linkage: #{bt.send(:linkage)} packaging: #{bt.send(:packaging)}"
puts " dynamic_library #{bt.send(:dynamic_library?)}"
puts " dynamic_framework #{bt.send(:dynamic_framework?)}"
puts " static_library #{bt.send(:static_library?)}"
puts " static_framework #{bt.send(:static_framework?)}"
end
end
It crashes at Could not get BatchedBridge, make sure your bundle is packaged correctly:
void JSIExecutor::bindBridge() {
std::call_once(bindFlag_, [this] {
SystraceSection s("JSIExecutor::bindBridge (once)");
Value batchedBridgeValue =
runtime_->global().getProperty(*runtime_, "__fbBatchedBridge");
if (batchedBridgeValue.isUndefined() || !batchedBridgeValue.isObject()) {
throw JSINativeException(
"Could not get BatchedBridge, make sure your bundle is packaged correctly");
}
Is this acceptable solution or is there another work-around?
Version
0.69.4
Output of npx react-native info
info Fetching system and libraries information… System: OS: macOS 12.4 CPU: (10) arm64 Apple M1 Max Memory: 159.59 MB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 16.16.0 - /usr/local/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn npm: 8.11.0 - /usr/local/bin/npm Watchman: 2022.03.21.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 25, 26, 27, 28, 29, 30, 31 Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0 System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-32 | Google APIs ARM 64 v8a, android-R | Google APIs Intel x86 Atom, chromeos-67 | Chrome OS 67 Android NDK: 22.1.7171670 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 11.0.16 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
See above desc.
Snack, code example, screenshot, or link to a repository
Nothing more.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (8 by maintainers)
Yeah, can confirm 0.69.5 crashes on Release iOS build with
use_frameworks!
and hermes.What’s almost worse is that development builds work. They apparently silently fall back to JSC.
react-native-firebase
is forced to useuse_frameworks!
due to upstream firebase libraries. They can’t fix the problem going forward no matter what. That means that currently nobody can make release builds on iOS if they use what is probably one of the most popular libraries in the RN ecosystem. Downgrading to rn-firebase v14.11.1 is only a temporary fix.The fix for this seem to clearly lie with react-native or hermes. How can we get this issue some attention? It’s likely impacting a lot of people.
We ran into this issue, too. react-native-firebase
15.x
requiresuse_frameworks!
, per:https://rnfirebase.io/#altering-cocoapods-to-use-frameworks
For us, the solution was to downgrade
react-native-firebase
to14.x
(and disableuse_frameworks!
) until there is better support for Hermes +use_frameworks!
. Apparently0.69.1
was supposed to have some support (and there was apatch-package
for it at some point), but even with RN0.69.4
, it’s still clearly not fully supported.It’s trivial to reproduce this issue. Just bootstrap a new, vanilla
react-native
app, edit thePodfile
, enableuse_frameworks!
and set:hermes_enabled => true
. Then, just run aRelease
build, and it’ll crash with the above error.OK this appears to work on react-native-reanimated. We need t get that pushed out …
same with 0.69.5 too,