I'm trying to integrate Razorpay with my react-native application using there official documentation from- https://razorpay.com/docs/payment-gateway/react-native-integration/standard/android/ but I'm getting this exception while running the application. No duplicate imports are there inside the MainApplication.java.
In step 2 of setting up react-native-razorpay, I was adding these 2 lines in MainApplication.java:
import com.razorpay.rn.RazorpayPackage;
and
packages.add(new RazorpayPackage());
I got rid of this error by removing these 2 lines. The package is automatically added later on during build time by autolinking. Removing these 2 lines solved my issue.
I had a similar error but with a different package. Looks as though the packages are added much later I have no idea when and how though. React Native "^0.64.0"
Native module Orientation tried to override OrientationModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice.
Solution
In MainApplication.java
:
// import com.github.yamill.orientation.OrientationPackage; <----- Commented out or removed
List<ReactPackage>
// packages.add(new OrientationPackage()); // <----- Commented out or removed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With