nitish24p / react-native-upi

A tiny module for Adding payments via UPI in your react native apps ❤️
MIT License
77 stars 30 forks source link

TypeError: null is not an object (evaluating 'UpiModule.intializePayment') #36

Open hardik323 opened 2 years ago

hardik323 commented 2 years ago

image

vaibhavyb commented 2 years ago

Even I got the same error, Anyone how to resolve this issue??

panchamsheoran77 commented 2 years ago

I faced the same error got it resolved by doing manuall linking of library

hardik323 commented 2 years ago

I faced the same error got it resolved by doing manuall linking of library

@panchamsheoran77 Can you please advice?

panchamsheoran77 commented 2 years ago

@hardik323 please follow manually linking steps for this library automatic linking is not working well for this package

  1. Open android/settings.gradle add the following include ':react-native-upi-payment' project(':react-native-upi-payment').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-upi-payment/android')
  2. Open android/build.gradle add the following in the dependencies section dependencies { compile project(':react-native-upi-payment') }
  3. Open MainApplication.java

import com.upi.payment.UpiPaymentPackage; 4.Add this in the Main Application Class

 @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
       //... Other packages
          new UpiPaymentPackage() // <- Add this line
    );
  }
hardik323 commented 2 years ago

Thanks @panchamsheoran77 😊