bebnev / react-native-user-agent

Library that helps you to get mobile application user agent and web view user agent strings
MIT License
41 stars 38 forks source link

Duplicate interface definition for class RCTModuleRegistry #27

Open markstreich opened 2 years ago

markstreich commented 2 years ago

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
alihaydar56 commented 1 year ago

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

markstreich commented 1 year ago

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

UsmanVirtueNetz commented 3 weeks ago

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