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

build fails with Could not resolve project error #11

Closed jitendra-koodo closed 4 years ago

jitendra-koodo commented 4 years ago

I'm following manual instructions as "link" did not work but getting this error:

FAILURE: Build failed with an exception.

jitendra-koodo commented 4 years ago

Adding matching fallbacks also did not help.

jitendra-koodo commented 4 years ago

This is my settings.gradle

include ':react-native-upi' project(':react-native-upi').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-upi/android')

rootProject.name = 'MyApp' apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app'

nitish24p commented 4 years ago

Can you try react-native link once and retry the build

nitish24p commented 4 years ago

From what i see on google this seems more like a gradle issue than a library issue.

jitendra-koodo commented 4 years ago

Thanks Nitish for your response. I got it running by not linking it altogether (manual or one line command). I just ran the build command. All build command do the linking as well and it worked, mostly.

But after successful/cancelled transaction from Google Pay when its returning back to original app, app is crashing. In both cases, it prints the message in respective callback and app crashes.

Here is the code: what could be the reason? Thanks for your help. Appreciated.

const floo = () => { ToastAndroid.show('Button pressed', ToastAndroid.SHORT); RNUpiPayment.initializePayment({ vpa: 'myupi@yesbank', // or can be john@ybl or mobileNo@upi payeeName: 'Jitendra', amount: '1', transactionRef: '1234321' },successCallback,failureCallback); }

const failureCallback = (data) => { console.log("failure 3"); console.log(data); } const successCallback = (data) => { console.log("success 3"); console.log(data); }

nitish24p commented 4 years ago

Can you do an adb logcat debug to see what the logs are when it crashes?

nitish24p commented 4 years ago

closing this as i dont see it as a build error, for the crash you could open another issue.