Troubleshooting and FAQs
Troubleshoot common error scenarios and find answers to frequently asked questions about Standard React Native integration.
dyld: Library not loaded: @rpath/libswiftCoreGraphics.dylibReferenced from: /private/var/mobile/Containers/Bundle/Application/696F0EAD-E2A6-4C83-876F-07E3D015D167/<Your_App>.app/Frameworks/<Framework_Name>.framework/<Framework_Name>Reason: image not found
To work around this issue, in your Xcode project:
-
Set the
.Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT)
build setting toYES
in your app. Know more -
Navigate to Target Settings → General and ensure that:
- The framework is added in Frameworks, Libraries, and Embed Content.
- Change Embed status from - 'Do not Embed' to 'Embed & Sign'.
-
Verify that you have installed CocoaPods.
For Android, if you are using proguard for your builds, you need to add the following lines to proguard files.
-keepattributes *Annotation*-dontwarn com.razorpay.**-keep class com.razorpay.** {*;}-optimizations !method/inlining/-keepclasseswithmembers class * {public void onPayment*(...);}
Auto linking is possible only if you are using React Native version 0.60+. Use the code given below to install and run the SDK:
npm install react-native-razorpay --savecd ios && open podfile # Change the platform from iOS 9.0 to 10.0pod install && cd .. # CocoaPods on iOS needs this extra step
yarn react-native run-ios
If you are using React Native version 0.59 and lower, follow the steps given below to install, link and run the SDK:
-
Install the SDK.
$ npm install react-native-razorpay --save // Install the Razorpay React Native Standard SDK using the npm command. -
Link the SDK.
react-native link react-native-razorpay // Link the SDK with React Native Project using Xcode. -
Configure the SDK.
- Drag the Razorpay.framework file from the Libraries folder and drop it under the root folder.
- Set the
Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT)
build setting toYES
in your app. Know more . - Navigate to Target Settings → General and ensure that:
- The framework is added in Frameworks, Libraries, and Embed Content.
- Change Embed status from - 'Do not Embed' to 'Embed & Sign'.
To manually link the SDK, the steps differ for iOS and Android platforms.
Add the following line to your build targets in your Podfile.
pod 'react-native-razorpay', :path => '../node_modules/react-native-razorpay'
Run the following command:
pod install
- In XCode, go to the project navigator:
- Right-click Libraries.
- Add files to [your project's name].
- Go to
node_modules/react-native-razorpay
. - Add the
.xcodeproj
file.
- In the project navigator, select your project:
Add the libRNDeviceInfo.a
from the deviceinfo project to your project's Build Phases ➜ Link Binary With Libraries.- Click
.xcodeproj
file you added before in the project navigator and go to the Build Settings tab. Make sure All is selected (instead of Basic). - Look for Header Search Paths and make sure it contains both
$(SRCROOT)/../react-native/React
and$(SRCROOT)/../../React
. Mark both as recursive (should be OK by default).
- Run your project using the Cmd+R keys.
Follow the steps to perform manual linking:
-
Open android/app/src/main/java/[...]/MainApplication.java
.- Add
import com.razorpay.rn.RazorpayPackage;
to the imports. - Add
new RazorpayPackage()
to the list returned by thegetPackages()
method.
- Add
-
Append the following lines to
android/settings.gradle
:include ':react-native-razorpay'project(':react-native-razorpay').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-razorpay/android') -
Insert the following lines inside the dependencies block in android/app/build.gradle:
implementation project(':react-native-razorpay')
-
Go to iOS folder in your project and run 'pod update' to update all the pods.
-
If you do not want to update all pods, run 'pod update razorpay-pod'
To raise a request for a new feature, go to New Issue → Feature Request on our
.7. I am facing issues integrating the Razorpay React Native Plugin with my React Native Expo app. How do I resolve this?
Expo does not support native code, so you cannot integrate with the Razorpay React Native Plugin. As a workaround, you can load the Razorpay page in a web view and use the callback URL logic to accept payments in your React Native Expo app. Check the
8. In the new M1 MacBook, why am I not able to compile the React Native Razorpay plugin for release mode?
New changes introduced in Xcode 12 might cause the issue.
To resolve this:
- Use for launching the app on your Mac.
- Add the following lines to Podfile within
post_install do |installer|
.
installer.pods_project.build_configurations.each do |config|config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"end
Know more about
.Is this integration guide useful?
ON THIS PAGE