razorpay / react-native-razorpay

React Native wrapper for Razorpay's mobile SDKs
https://www.npmjs.com/package/react-native-razorpay
MIT License
124 stars 107 forks source link

[ios] Razorpay pod resulting in error in react native 0.67.2 #392

Closed Abhishek12345679 closed 2 years ago

Abhishek12345679 commented 2 years ago

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest React Native Razorpay plugin release to make sure your issue has not already been fixed.

Razorpay Package Version :

2.2.8

Xcode Version (iOS) :

Version 13.3 beta 2 (13E5095k)

Razorpay-pod version (iOS) :

razorpay-pod (1.1.18)

What did you do:

ran

npx react-native run-ios

What happened:

In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.m:9:
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.h:9:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:14:1: error: duplicate interface definition for class 'RCTEventEmitter'
@interface RCTEventEmitter : NSObject <RCTBridgeModule, RCTInvalidating>
^
In module 'React' imported from /Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:8:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:14:12: note: previous definition is here
@interface RCTEventEmitter : NSObject <RCTBridgeModule, RCTInvalidating>
           ^
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.m:9:
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.h:9:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:16:40: error: property has a previous declaration
@property (nonatomic, weak) RCTBridge *bridge;
                                       ^
In module 'React' imported from /Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:8:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:16:40: note: property declared here
@property (nonatomic, weak) RCTBridge *bridge;
                                       ^
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.m:9:
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.h:9:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:17:48: error: property has a previous declaration
@property (nonatomic, weak) RCTModuleRegistry *moduleRegistry;
                                               ^
In module 'React' imported from /Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:8:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:17:48: note: property declared here
@property (nonatomic, weak) RCTModuleRegistry *moduleRegistry;
                                               ^
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.m:9:
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.h:9:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:18:46: error: property has a previous declaration
@property (nonatomic, weak) RCTViewRegistry *viewRegistry_DEPRECATED;
                                             ^
In module 'React' imported from /Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:8:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:18:46: note: property declared here
@property (nonatomic, weak) RCTViewRegistry *viewRegistry_DEPRECATED;
                                             ^
In file included from /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.m:9:
/Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.h:13:35: error: definition of 'RCTEventEmitter' must be imported from module 'React.RCTEventEmitter' before it is required
@interface RazorpayEventEmitter : RCTEventEmitter
                                  ^
In module 'React' imported from /Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:8:
/Users/abhishek/dev/personal/AushNative/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h:14:12: note: definition here is not reachable
@interface RCTEventEmitter : NSObject <RCTBridgeModule, RCTInvalidating>
           ^
5 errors generated.

2022-02-14 03:25:27.409 xcodebuild[12793:47235] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-02-14 03:25:27.409 xcodebuild[12793:47235] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **

The following build commands failed:
    CompileC /Users/abhishek/Library/Developer/Xcode/DerivedData/HelloWorld-eptxsiwcsexhuddseidywwbtzimm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-razorpay.build/Objects-normal/x86_64/RazorpayEventEmitter.o /Users/abhishek/dev/personal/AushNative/node_modules/react-native-razorpay/ios/RazorpayEventEmitter.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-razorpay' from project 'Pods')
(1 failure)

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. install the latest version of react-native-razorpay
  2. cd ios and pod install in the ios directory.
  3. run npx react-native run-ios

Suggested solution:

i use an m1 mac, and i added the lines in the podfile as suggested by the docs, but that did not help i think. maybe the latest react-native version is causing some issues ?

Code example, screenshot, or link to a repository:

Please provide a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

Abhishek12345679 commented 2 years ago

https://github.com/expo/expo/issues/15622: this has the info on how to fix it.

At the moment, you can follow this comment in the above linked thread.

This will fix it for react-native-razorpay atleast.

note: if you are using expo-modules for unimodules, try using

expo run:ios

instead of

npx react-native run-ios