Closed rsunbabu closed 3 years ago
@rsunbabu You have replaced RNRazorpayCheckout
with RazorpayCheckout
on line number 21. If the issue still persists then I will suggest you to remove the Razorpay plugin and add it again.
Thankyou, its working. Please close this.
As per your suggestion, I had re-run the "npm i react-native-razorpay" but without uninstalling it
Facing the same issue @Nautiyalsachin .
My configuration details goes here:-
MacOS 11.2.2 XCode 12.4
"react-native": "0.60.4" "react-native-razorpay": "2.1.3"
Tried removing node_modules and Pods folder, installed back again. Tried upgrading "react-native-razorpay" to "2.2.4" as well. No luck so far.
Any help would be greatly appreciated!!!
@bala-kredx It would help if you can add more details here. Screenshots, code snippets will help.
@Nautiyalsachin
Couldnt generate the iOS build in Xcode.
Using the below in package.json
"react-native-razorpay": "2.1.3", "react-native": "0.60.4",
No pods present in podfile for razorpay.
RazorpayCheckout.m
`
// RazorpayCheckout.m
// RazorpayCheckout
//
// Created by Akshay Bhalotia on 29/08/16.
// Copyright © 2016 Razorpay. All rights reserved.
//
#import "RazorpayCheckout.h"
#import "RazorpayEventEmitter.h"
//#import <Razorpay/Razorpay.h>
#import <Razorpay/Razorpay-Swift.h>
@interface RazorpayCheckout () <RazorpayPaymentCompletionProtocolWithData,
ExternalWalletSelectionProtocol>
@end
@implementation RazorpayCheckout
RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(open : (NSDictionary *)options) {
NSString *keyID = (NSString *)[options objectForKey:@"key"];
dispatch_sync(dispatch_get_main_queue(), ^{
Razorpay *razorpay = [Razorpay initWithKey:keyID
andDelegateWithData:self];
[razorpay setExternalWalletSelectionDelegate:self];
[razorpay open:options];
});
}
- (void)onPaymentSuccess:(nonnull NSString *)payment_id
andData:(nullable NSDictionary *)response {
[RazorpayEventEmitter onPaymentSuccess:payment_id andData:response];
}
- (void)onPaymentError:(int)code
description:(nonnull NSString *)str
andData:(nullable NSDictionary *)response {
[RazorpayEventEmitter onPaymentError:code description:str andData:response];
}
- (void)onExternalWalletSelected:(nonnull NSString *)walletName
WithPaymentData:(nullable NSDictionary *)paymentData {
[RazorpayEventEmitter onExternalWalletSelected:walletName
andData:paymentData];
}
`
Hi @baalarazor, As I can see now you are using 2.1.4 plugin version, please upgrade that to the latest 2.2.4. Also, run a command pod update
from your ios folder, that will download the latest iOS SDK, which will fix this issue. Let me know if this still persists. Thanks.
@Nautiyalsachin
The aforementioned errors arise when I do the following:-
2.2.4
pod update
from my ios folder.Thanks.
@bala-kredx Can you share the razorpay-pod version from your project? You can find it inside ios>podfile.lock file.
@bala-kredx Can you share the razorpay-pod version from your project? You can find it inside ios>podfile.lock file.
@Nautiyalsachin
- razorpay-pod (1.1.12)
Please create a sample app and share with us here, we will check it.
@Nautiyalsachin
Here's the git repo for simple app with react native 0.60.4 and latest react-native-razorpay Getting the errors as mentioned above in the thread https://github.com/bala-kredx/Sample
Thanks.
@Nautiyalsachin Any update on this front?
@bala-kredx - It worked for me. I did
npm install
pod repo update
inside ios folder.pod install
. I am not seeing any error. Let me know if I have missed anything here.
Did the same here. Running into the issues as I shared above. @Nautiyalsachin
Hey @bala-kredx, please try removing the plugin and adding it again, as there can be some connectivity issue in between react native and XCode.
You can also try this suggestion from React Native Documentation.
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues.
@Nautiyalsachin Tried the above. Couldn't succeed build generation. Here are my tries in steps:-
Try 1:-
- npm uninstall react-native-razorpay
- rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-map-* && rm -rf node_modules/ && npm cache verify
- restart my Mac (Mac 11.2.3 - Apple M1 Chip)
- npm i
- npm i react-native-razorpay
- npm start -- --reset-cache
- Goto Xcode, Clean Build folder, Build again.
(Running into same set of issues as mentioned below :- )
Try 2:-
- npm uninstall -g react-native-cli
- Restart my Mac
- rm -rf $TMPDIR/metro-* && rm -rf $TMPDIR/haste-map-* && rm -rf node_modules/ && npm cache verify
- npm i
- npm i react-native-razorpay
- npm start -- --reset-cache
- Goto Xcode, Clean Build folder, Build again.
(Running into the same 5 issues as mentioned above)
@bala-kredx Can you try manual linking also? You can refer our readme manual section for more details.
@bala-kredx Can you try manual linking also? You can refer our readme manual section for more details.
Okay, would try it now!
@Nautiyalsachin tried out manual linking. Still gives the same errors on iOS build generation.
@bala-kredx I have tried the sample app, you shared and the linking is working fine for me, I would suggest you downgrade the XCode and try again.
@Nautiyalsachin Could not downgrade Xcode, as the lower versions such as 11.x isn't getting installed in my machine.
@bala-kredx do you use the Apple Silicon MacBook? if Yes then try running with Rosetta 2.
Description
Build using XCODE isnt working. The same is working without any flaw when run on a simulator.
Razorpay Package Version :
Open
Package.json
. >react-native-razorpay
"^2.2.4"Xcode Version (iOS) :
Open Xcode > Go to
About Xcode
> Xcode 12.4(12D4e).Razorpay-pod version (iOS) :
Go to your project path > Go to folder named
ios
> open 'podfile.lock' file > search for 'razorpay-pod' > razorpay-pod (1.1.12)Java and Gradle Version (android) :
Android is working fine, build and APK generated and tested
What you did:
What happened:
Android worked and for iOS, stared the build and the errors were visible
Refer the screenshot attached
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Suggested solution:
Had tried all the options given in the docs, none worked
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