react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

RNNBridgeEventEmitter does not conform to the RCTBridgeModule

Open kaloyanxoxo opened this issue 6 months ago • 3 comments

What happened?

After upgrading react-native to 0.77.2 and react-native-navigation to 8.1.0, we started seeing this issue:

RNNBridgeEventEmitter does not conform to the RCTBridgeModule

What was the expected behaviour?

App runs without issues

Was it tested on latest react-native-navigation?

  • [x] I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

I created new application with the following command:

npx @react-native-community/cli@latest init TestApp --version 0.77.2

After that - I added the navigation as suggested in the documentation for version 8.1.0

running the application resulted in:

error no such module 'ReactNativeNavigation'
error Failed to build ios project. "xcodebuild" exited with error code '65'. To debug build logs further, consider building your app with Xcode.app, by opening 'TestApp.xcworkspace'.
error Command failed with exit code 1.

In what environment did this happen?

React Native Navigation version: 8.1.0 React Native version: 0.77.2 Has Fabric (React Native's new rendering system) enabled: (yes/no) yes Node version: 20.18 Device model: iPhone 16 Pro iOS version: 18.1

kaloyanxoxo avatar Jun 18 '25 07:06 kaloyanxoxo

the same isssue

batuctn avatar Jun 19 '25 12:06 batuctn

I think I managed to find fix. Give me some time and I'll come back to confirm if it actually works

kaloyanxoxo avatar Jun 19 '25 13:06 kaloyanxoxo

I managed to build with Xcode.

It wasn't recognizing the project as swift, so I had to manually switch it swift_project = true in the .podspec file. After that I had to add couple of paths in:

Main Target -> Build Settings -> Library Search Paths

Image

I'm still working on a better way to handle it, but it is building through Xcode

kaloyanxoxo avatar Jun 19 '25 14:06 kaloyanxoxo

@kaloyanxoxo I've tried your suggestion but still doesn't work for me. Has anyone else had success?

Abramovick avatar Jun 22 '25 17:06 Abramovick

Can you try the following patch:

diff --git a/node_modules/react-native-navigation/ReactNativeNavigation.podspec b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
index f189f90..0114712 100644
--- a/node_modules/react-native-navigation/ReactNativeNavigation.podspec
+++ b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
@@ -4,11 +4,13 @@ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
 
 fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
 
+#  This does not work for us
 # Detect if this is a Swift project by looking for user AppDelegate.swift files
-dependency_paths = ['/node_modules/', '/Pods/', '/build/', '/Build/', '/DerivedData/']
-swift_project = Dir.glob('**/AppDelegate.swift')
-                   .reject { |file| dependency_paths.any? { |path| file.include?(path) } }
-                   .any?
+# dependency_paths = ['/node_modules/', '/Pods/', '/build/', '/Build/', '/DerivedData/']
+# swift_project = Dir.glob('**/AppDelegate.swift')
+#                    .reject { |file| dependency_paths.any? { |path| file.include?(path) } }
+#                    .any?
+swift_project = true;
 
 # Debug output
 if swift_project
@@ -42,11 +44,37 @@ Pod::Spec.new do |s|
     end
   end
 
-  folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DFOLLY_CFG_NO_COROUTINES=1'
+  folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32'
+
+  header_search_paths = [
+    '"$(PODS_ROOT)/Headers/Private/React-Core"', # as React-RCTAppDelegate.podspec to access JSCExecutorFactory.h
+    '"$(PODS_ROOT)/boost"',
+    '"$(PODS_ROOT)/boost-for-react-native"',
+    '"$(PODS_ROOT)/RCT-Folly"',
+    '"$(PODS_ROOT)/Headers/Private/Yoga"',
+    '"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector/jsinspector_modern.framework/Headers"',
+  ]
+  if fabric_enabled
+    header_search_paths.concat([
+      # [begin] transitive dependencies of React-RCTAppDelegate that are not defined modules
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeApple/React_RuntimeApple.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeCore/React_RuntimeCore.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-jserrorhandler/React_jserrorhandler.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererdebug/React_rendererdebug.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-nativeconfig/React_nativeconfig.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAppDelegate/React_RCTAppDelegate.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-performancetimeline/React_performancetimeline.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererconsistency/React_rendererconsistency.framework/Headers"',
+      # [end] transitive dependencies of React-RCTAppDelegate that are not defined modules
+    ])
+  end
   
   # Base xcconfig settings
   xcconfig_settings = {
-      'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native"  "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
+      'HEADER_SEARCH_PATHS' => header_search_paths.join(' '),
       "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
       "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
   }
@@ -65,6 +93,7 @@ Pod::Spec.new do |s|
     s.requires_arc    = true
 
     s.dependency "React"
+    s.dependency "React-Core"
     s.dependency "React-RCTFabric"
     s.dependency "React-cxxreact"
     s.dependency "React-Fabric"

kaloyanxoxo avatar Jun 23 '25 05:06 kaloyanxoxo

I managed to make the navigation register correctly app launch with the provided patch. The Library search paths may not be needed.

The patch is still WIP, I didn't have much time to make better solution yet. I'll come back when I have better solution

kaloyanxoxo avatar Jun 24 '25 05:06 kaloyanxoxo

fixed in #8056

gosha212 avatar Jul 21 '25 11:07 gosha212