Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on iOS build with Expo SDK 44 - duplicate interface definition for class 'RCTModuleRegistry' #106

Closed
DenianFossatti opened this issue Mar 29, 2022 · 2 comments

Comments

@DenianFossatti
Copy link
Contributor

DenianFossatti commented Mar 29, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-in-app-review@3.3.2 for the project I'm working on.

Started after install expo and expo-updates.

References from same error with suggested fix:

ibitcy/react-native-hole-view#12
expo/expo#15626
https://github.com/LinusU/react-native-get-random-values/pull/33/files
expo/expo#15622 (comment)
expo/expo#15626

------------------- LOG -----------------------

❌ (<MY_APP_PATH>/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:415:1)

413 | * A class that allows NativeModules and TurboModules to look up one another.
414 | */

415 | @interface RCTModuleRegistry : NSObject
| ^ duplicate interface definition for class 'RCTModuleRegistry'
416 | - (void)setBridge:(RCTBridge *)bridge;
417 | - (void)setTurboModuleRegistry:(id)turboModuleRegistry;
418 |

❌ (<MY_APP_PATH>/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:429:1)

427 | * A class that allows NativeModules/TurboModules to read/write the bundleURL, with or without the bridge.
428 | */

429 | @interface RCTBundleManager : NSObject
| ^ duplicate interface definition for class 'RCTBundleManager'
430 | - (void)setBridge:(RCTBridge *)bridge;
431 | - (void)setBridgelessBundleURLGetter:(RCTBridgelessBundleURLGetter)getter
432 | andSetter:(RCTBridgelessBundleURLSetter)setter

❌ (<MY_APP_PATH>/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:435:18)

433 | andDefaultGetter:(RCTBridgelessBundleURLGetter)defaultGetter;
434 | - (void)resetBundleURL;

435 | @Property NSURL *bundleURL;
| ^ property has a previous declaration
436 | @EnD
437 |
438 | typedef UIView * (^RCTBridgelessComponentViewProvider)(NSNumber *);

❌ (<MY_APP_PATH>/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:443:1)

441 | * A class that allows NativeModules to query for views, given React Tags.
442 | */

443 | @interface RCTViewRegistry : NSObject
| ^ duplicate interface definition for class 'RCTViewRegistry'
444 | - (void)setBridge:(RCTBridge *)bridge;
445 | - (void)setBridgelessComponentViewProvider:(RCTBridgelessComponentViewProvider)bridgelessComponentViewProvider;
446 |

❌ (<MY_APP_PATH>/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:460:1)

458 | * as callable with React Native.
459 | */

460 | @interface RCTCallableJSModules : NSObject
| ^ duplicate interface definition for class 'RCTCallableJSModules'
461 | - (void)setBridge:(RCTBridge *)bridge;
462 | - (void)setBridgelessJSModuleMethodInvoker:(RCTBridgelessJSModuleMethodInvoker)bridgelessJSModuleMethodInvoker;
463 |

› Compiling » ExpoModulesProvider.swift
› Executing react-native-config Pods/react-native-config » [CP-User] Config codegen
› Compiling react-native-reanimated Pods/RNReanimated » FrozenObject.cpp
› Compiling react-native-reanimated Pods/RNReanimated » NativeProxy.mm
› Compiling react-native-reanimated Pods/RNReanimated » EventHandlerRegistry.cpp
› Compiling expo-updates Pods/EXUpdates » EXUpdatesUtils.m
› Compiling expo-updates Pods/EXUpdates » EXUpdatesUpdate.m
› Compiling react-native-screens Pods/RNScreens » UIViewController+RNScreens.m

› 5 error(s), and 0 warning(s)

Failed to build iOS project. "xcodebuild" exited with error code 65.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

------------------- END LOG ------------------

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS-Bridging-Header.h b/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS-Bridging-Header.h
index 129af5f..279ad57 100755
--- a/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS-Bridging-Header.h
+++ b/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS-Bridging-Header.h
@@ -1,5 +1 @@
-#if __has_include("RCTBridgeModule.h")
-#import "RCTBridgeModule.h"
-#else
 #import <React/RCTBridgeModule.h>
-#endif
diff --git a/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS.m b/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS.m
index 5055e2e..3f158e8 100755
--- a/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS.m
+++ b/node_modules/react-native-in-app-review/ios/RNInAppReviewIOS.m
@@ -1,7 +1,7 @@
 #import <Foundation/Foundation.h>
 #import <StoreKit/SKStoreReviewController.h>
 #import <UIKit/UIKit.h>
-#import "RCTBridgeModule.h"
+#import <React/RCTBridgeModule.h>
 
 @interface RCT_EXTERN_MODULE(RNInAppReviewIOS, NSObject)
 

This issue body was partially generated by patch-package.

@DenianFossatti DenianFossatti changed the title Error on iOS build with Expo SDK 44 Error on iOS build with Expo SDK 44 - duplicate interface definition for class 'RCTModuleRegistry' Mar 29, 2022
@DenianFossatti
Copy link
Contributor Author

I create a pull request also:

#107

@MinaSamir11
Copy link
Owner

PR Merged
also update available on npm.

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants