Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'native module cannot be null' #22

Closed
captn3m0 opened this issue Apr 26, 2017 · 20 comments
Closed

'native module cannot be null' #22

captn3m0 opened this issue Apr 26, 2017 · 20 comments

Comments

@captn3m0
Copy link
Contributor

Issue reported over chat for iOS

@akshaybhalotia
Copy link
Contributor

akshaybhalotia commented Apr 26, 2017

Need more information to help with this. Send stacktrace and try some fixes as suggested by Google.

@akshaybhalotia
Copy link
Contributor

No activity on this for long, closing for now.

@jaspal747
Copy link

jaspal747 commented Sep 8, 2017

Receiving this error on iOS

screen shot 2017-09-08 at 11 14 12 am

I am using RN V0.44, React V16.0.0-alpha.6, RazorPay V^1.4.0

Thanks

@jaspal747
Copy link

Was able to resolve this by relaunching the simulator and the terminal (react-native run-ios).

Thanks

@ccupal
Copy link

ccupal commented Apr 13, 2018

simulator screen shot - iphone x - 2018-04-13 at 11 30 03
I am getting same problem, i did [Was able to resolve this by relaunching the simulator and the terminal (react-native run-ios).], but error still persists.

I am using Expo V^23.0.4, RN V0.50.3, React V16.0.0, RazorPay V^2.0.3

Thanks in advance.

@iThink32
Copy link
Contributor

iThink32 commented Apr 13, 2018

Hey please provide more details as in which version of our package are you using and which version of Xcode are you using?. If you are not using version 2.0.3 of react-native-razorpay , update to the latest version i.e 2.0.3 and try.

@ccupal
Copy link

ccupal commented Apr 13, 2018

I am using Expo V^23.0.4, RN V0.50.3, React V16.0.0, RazorPay V^2.0.3.

@iThink32
Copy link
Contributor

iThink32 commented Apr 13, 2018

did your issue get solved? can you check if your library has been properly linked on react-native by following the manual process written in the readme?

@ccupal
Copy link

ccupal commented Apr 13, 2018

My problem is not solved yet in IOS, but in android i am able to see: error alert() as [Undefined | Undefined] through this line:
alert(Error: ${error.code} | ${error.description});

@iThink32
Copy link
Contributor

iThink32 commented Apr 13, 2018

I can help you integrate it in react-native as I believe it is an integration issue , can u send your integration steps to integrations@razorpay.com so that I can verify it?

@ccupal
Copy link

ccupal commented Apr 13, 2018

I followed these steps:

  1. $ npm i react-native-razorpay --save

  2. $ react-native link react-native-razorpay
    Linking Result:
    rnpm-install info Linking react-native-razorpay android dependency
    rnpm-install info Android module react-native-razorpay has been successfully linked
    rnpm-install info Linking react-native-razorpay ios dependency
    rnpm-install info iOS module react-native-razorpay has been successfully linked

  3. I have created screen with these codes: https://github.com/razorpay/react-native-razorpay/blob/master/example/index.js

Once i Run the project from terminal: $ npm start

IOS:

Error in red Screen coming as "native module cannot be null" link: https://user-images.githubusercontent.com/32872520/38719156-1aab06a2-3f0e-11e8-84bf-a62c5a070ee3.png in IOS (Note: error not coming if i am removing this line "import RazorpayCheckout from 'react-native-razorpay';", but we must need to import "RazorpayCheckout")

Android:

After clicking on PAY:
whatsapp image 2018-04-13 at 4 31 39 pm

  1. I downloaded IOS SDK -Razorpay(with bit code enabled) from https://rzp-mobile.s3.amazonaws.com/ios/checkout/1.0.12/RazorpayBitcodeX9.framework.zip

  2. I Unzipped above downloaded file, and i open "myProject.xcodeproj" with Xcode (as i have a file at location: $Project/IOS/myProject.xcodeproj)

  3. then i followed these steps:

-Download the SDK from above and unzip it.
-Open your project in XCode and go to file under Menu. Select Add files to "yourproject".
-Select Razorpay.framework in the directory you just unzipped.
-Select the Copy items if needed check-box.
-Click Add.
-Navigate to Target settings > General and add the Razorpay.framework in both Embeded Binaries and Linked Frameworks and Libraries.

(Note: After adding [Razorpay.framework] into "Embeded Binaries" it is also showing in the "Linked Frameworks and Libraries", so i skipped to add)

i am not able to follow the steps from: https://razorpay.com/docs/ios/#step-2-initialize-the-razorpay-sdk, because not able to find "ViewController.swift" in entire project.

@iThink32
Copy link
Contributor

iThink32 commented Apr 13, 2018

Hey I believe there is something wrong in the way you are integrating the sdk ,you cannot add the framework directly to the project, you have to add it under libraries and then add the static library to your main projects Link binary with libraries (this step should only be used if react-native link react-native-razorpay fails).Moreover the steps which you have sent is not in accordance with the readme as you are following the link for the iOS sdk integration and not the react-native one.Please follow the link below and reply on integrations@razorpay.com if you still face any further issue.
Another important note please use Xcode 9.3 this version will not work on Xcode 9.2 and prior.

https://github.com/razorpay/react-native-razorpay

@ccupal
Copy link

ccupal commented Apr 13, 2018

it doesn't work with the tools like expo which doesn't support native modules.

It's my mistake, i had not seen "Things to be taken care:"
here Link: https://github.com/razorpay/react-native-razorpay

Because i had already mentioned in reply as I am using Expo V^23.0.4, RN V0.50.3, React V16.0.0, RazorPay V^2.0.3.

screen shot 2018-04-13 at 6 49 49 pm

@iThink32
Copy link
Contributor

closing the ticket as the issue is resolved.

@Prateek479
Copy link

@iThink32 : can you please help me with the integration , I followed all the steps mention in manual process , getting this error finally .

Check dependencies


Not running swift-stdlib-tool: ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES is enabled, but the product type 'Static Library' is not a wrapper type.

Unable to run command 'Libtool libRazorpayCheckout.a' - this target might include its own product.



** BUILD FAILED **



The following build commands failed:
	Check dependencies
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/addUpMath.app
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Underlying error (domain=MIInstallerErrorDomain, code=4):
	Failed to chmod /Users/pojha/Library/Developer/CoreSimulator/Devices/7F446955-5229-42CE-A97F-94F6E0FB22E8/data/Library/Caches/com.apple.containermanagerd/Bundle/Application/234FE417-42B6-40A2-9DE9-C004C5523294/addUpMath.app/addUpMath : No such file or directory

@iThink32
Copy link
Contributor

Hey @Prateek479 We now have integration videos , you can watch this and try it , if you still face issues ill help you fix it.

The link is https://youtu.be/hE-F0QqTwnI.

All these links will be uploaded on our docs page but for now you can use this.

@iThink32 iThink32 reopened this Jun 26, 2018
@iThink32
Copy link
Contributor

closing as this issue is fixed

@codebymani
Copy link

Everything working fine till Xcode 10.1 and react-native-razorpay: 2.1.23

I have updated my Xcode from 10.1 to 10.3. when I trigger "RazorpayCheckout.open()" it pops 'native module cannot be null' error. Surprisingly If linking fails, It should pop the error on launch. But It's popping when I call RazorpayCheckout.open().

I'm unable to figure out exactly what happening under the hood.

@Prateek479
Copy link

great Job @iThink32 , looks good to me 👍

@rahul0090392
Copy link

rahul0090392 commented Nov 7, 2019

Did all the steps give in above video @iThink32 . But build fails with error Library not found for - IDoubleConversion
Screenshot 2019-11-07 at 11 53 24 AM

Did all the steps as given:-
Screenshot 2019-11-07 at 11 54 26 AM
Screenshot 2019-11-07 at 11 54 38 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants