wgltony / react-native-braintree-dropin-ui

React Native integration of Braintree Drop-in for IOS & ANDROID (Apple Pay, Google Pay, Paypal, Venmo, Credit Card)
MIT License
78 stars 103 forks source link

[Android] have some issue #111

Open canhtran10 opened 1 year ago

canhtran10 commented 1 year ago

RN: 0.64 Java: 11

  1. I got errors: ` node_modules\react-native-braintree-dropin-ui\android\src\main\java\tech\power\RNBraintreeDropIn\RNBraintreeDropInModule.java:40: error: lambda expressions are not supported in -source 7

    dropInClient = new DropInClient(activity, callback -> { ^ (use -source 8 or higher to enable lambda expressions)`

I fixed issue by add compileOptions to node_modules/react-native-braintree-dropin-ui/android/build.gradle

` android {

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

} `

  1. I have developed on real Android devices with versions 10 and 13. I noticed that release versions 1.1.4 and 1.1.5 do not have any callbacks for successful or canceled payments when the user completes the payment process. However, when reverting to version 1.1.3, everything works fine. Additionally, on iOS, the new version runs without any issues.

Please take a look, thank you

Harisene commented 1 year ago

I'm having the same issue

Harisene commented 1 year ago

Hi @canhtran10 where did you exactly add below code? compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }

Harisene commented 1 year ago

I added

compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }

to android block in build.gradle and it did the trick. Now my concern is updating the build.gradle file inside a package is not a good practice as it reset when I run npm ci

As a solution I added a patch with patch-package

canhtran10 commented 1 year ago

Hi @canhtran10 where did you exactly add below code? compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }

@Harisene in this file path: node_modules/react-native-braintree-dropin-ui/android/build.gradle

android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }

mash-a commented 11 months ago

@canhtran10 Have you had any success with getting the callbacks to work when a payment is completed?