react-native-user-agent icon indicating copy to clipboard operation
react-native-user-agent copied to clipboard

Duplicate interface definition for class RCTModuleRegistry

Open markstreich opened this issue 2 years ago • 3 comments

I started getting this error after upgrading expo 43 to 45 (RN 0.64.3 to 0.68.2)

The below commit seems to fix, based on a similar report/fix I found (https://github.com/expo/expo/issues/15649), but I really don't understand the implications (I have near zero C or swift experience), so a bit scared of creating a PR.

fix (?): https://github.com/DealDash/react-native-user-agent/commit/8d70358067bfd522c8952a7bba649635f5f83154

Thanks!

In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:59:11: note: previous definition is here
@protocol RCTBridgeModule <NSObject>
          ^
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.m:6:
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.h:5:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:385:11: warning: duplicate protocol definition of 'RCTTurboModuleRegistry' is ignored [-Wduplicate-protocol]
@protocol RCTTurboModuleRegistry <NSObject>
          ^
In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:385:11: note: previous definition is here
@protocol RCTTurboModuleRegistry <NSObject>
          ^
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.m:6:
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.h:5:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:415:1: error: duplicate interface definition for class 'RCTModuleRegistry'
@interface RCTModuleRegistry : NSObject
^
In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:415:12: note: previous definition is here
@interface RCTModuleRegistry : NSObject
           ^
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.m:6:
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.h:5:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:429:1: error: duplicate interface definition for class 'RCTBundleManager'
@interface RCTBundleManager : NSObject
^
In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:429:12: note: previous definition is here
@interface RCTBundleManager : NSObject
           ^
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.m:6:
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.h:5:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:435:18: error: property has a previous declaration
@property NSURL *bundleURL;
                 ^
In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:435:18: note: property declared here
@property NSURL *bundleURL;
                 ^
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.m:6:
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.h:5:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:443:1: error: duplicate interface definition for class 'RCTViewRegistry'
@interface RCTViewRegistry : NSObject
^
In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:443:12: note: previous definition is here
@interface RCTViewRegistry : NSObject
           ^
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.m:6:
In file included from [redacted]/node_modules/react-native-user-agent/ios/RNUserAgent.h:5:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:460:1: error: duplicate interface definition for class 'RCTCallableJSModules'
@interface RCTCallableJSModules : NSObject
^
In module 'React' imported from [redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:11:
[redacted]/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h:460:12: note: previous definition is here
@interface RCTCallableJSModules : NSObject

markstreich avatar Jun 03 '22 12:06 markstreich

Hi @markstreich ! did you find any solution for this issue?

alihaydar56 avatar Feb 20 '23 05:02 alihaydar56

Hi @markstreich ! did you find any solution for this issue?

I posted the solution in my original post, https://github.com/DealDash/react-native-user-agent/commit/8d70358067bfd522c8952a7bba649635f5f83154

markstreich avatar Feb 22 '23 11:02 markstreich

Hi @markstreich can you please share the link to the solution?

UsmanVirtueNetz avatar Jun 13 '24 09:06 UsmanVirtueNetz