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

[Android] have some issue #111

Open
canhtran10 opened this issue Jul 28, 2023 · 5 comments
Open

[Android] have some issue #111

canhtran10 opened this issue Jul 28, 2023 · 5 comments

Comments

@canhtran10
Copy link

canhtran10 commented Jul 28, 2023

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
Copy link

I'm having the same issue

@Harisene
Copy link

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

@Harisene
Copy link

Harisene commented Aug 30, 2023

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
Copy link
Author

canhtran10 commented Aug 31, 2023

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
Copy link

mash-a commented Oct 9, 2023

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

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

3 participants