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

Google Play Error: SDK: Braintree Payments com.braintreepayments.api:data-collector (consider upgrading to version 4.31.0) #115

Open mgdeveloper7 opened 1 year ago

mgdeveloper7 commented 1 year ago

Hi,

We are using the latest version of the react-native-braintree-dropin-ui in our app. I recently submitted a build of an app to Google Play Store. The app got rejected giving the following reason:

**Issue found: Violation of User Data policy

We reviewed SDKs used by your app and found noncompliant version(s) of SDK(s) which collects persistent device identifiers. Persistent device identifiers may not be linked to other personal and sensitive user data or resettable device identifiers.

Issue details

We found an issue in the following area(s):

SPLIT_BUNDLE 28: : SDK: Braintree Payments com.braintreepayments.api:data-collector (consider upgrading to version 4.31.0)

Additionally, follow these steps to bring your app into compliance:

You may consider upgrading to a policy-compliant version of this SDK, if available from your SDK provider or removing the SDK.**

I've been submitting builds for this app for the last 18 months without issue until this week where it's been rejected. The User Data Policy on Google Play store had been updated recently.

Is there any way to upgrade the plugin to use version 4.31.0 of com.braintreepayments.api:data-collector as suggested?

Thanks

mgdeveloper7 commented 1 year ago

I found that version 4.27.0 is currently being pulled in after the build command is issued.

<library name="com.braintreepayments.api:data-collector:4.27.0@aar" jars="/Users/xxx/.gradle/caches/transforms-3/e55554a7a0707949ccc860a39bfa495d/transformed/jetified-data-collector-4.27.0/jars/classes.jar:/Users/xxx/.gradle/caches/transforms-3/e55554a7a0707949ccc860a39bfa495d/transformed/jetified-data-collector-4.27.0/jars/libs/kount-data-collector-3.2.jar" resolved="com.braintreepayments.api:data-collector:4.27.0"

Plug in needs version 4.31.0 or above.

Jigs6720 commented 1 year ago

add this line and upgrade braintree sdk to version 6.+

implementation 'com.braintreepayments.api:data-collector:4.31.0'

in app/build.gradle

like this

dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "io.card:android-sdk:5.+"
implementation 'com.braintreepayments.api:data-collector:4.31.0'
implementation 'org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.7-2'
ysudharsono commented 1 year ago

I encountered the same issue and ended up upgrading the library from v1.1.3 to v1.1.5, essentially upgrading the Braintree Android SDK to v4 and Braintree iOS SDK to v5. That seemed to have fixed the issue.

I had to upgrade the deployment targets for both Android & iOS to make it work with the latest version, plus some other changes. I would advise reviewing the latest readme file & make the necessary changes.

mgdeveloper7 commented 1 year ago

Thanks for you comments @Jigs6720 and @ysudharsono.

I managed to solve the problem in my app by changing the following in my build.gradle. I upgraded the version from to 6.9.0 to 6.11.0

implementation 'com.braintreepayments.api:drop-in:6.11.0'.

This seemed to pull in an updated version of the dependency on com.braintreepayments.api:data-collector to a version above 4.31.0.

I submitted the build to Play Store and it got approved so seemed to solve the problem :-).

pckz commented 1 year ago

Hello everyone,

I'm experiencing a Duplicate class issue in my React Native app (react-native: 0.63.2) when trying to integrate Braintree. I've gone through the solutions suggested in this thread but haven't had any luck solving the problem.

I'm specifically facing this issue with react-native-braintree-dropin-ui versions:

in three scenarios I got same error

Here's the error message I get during the build:

> Task :app:checkFirstDermReleaseDuplicateClasses FAILED

> Task :app:processFirstDermReleaseManifestForPackage
Execution optimizations have been disabled for task ':app:processFirstDermReleaseManifestForPackage' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/pckz/Apps/firstderm.native/android/app/build/intermediates/merged_manifests/FirstDermRelease'. Reason: Task ':app:processFirstDermReleaseManifestForPackage' uses this output of task ':app:copyFirstDermReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkFirstDermReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.braintreepayments.api.BuildConfig found in modules jetified-braintree-3.21.1-runtime (com.braintreepayments.api:braintree:3.21.1) and jetified-braintree-core-4.31.0-runtime (com.braintreepayments.api:braintree-core:4.31.0)
     Duplicate class com.braintreepayments.api.CrashReporter found in modules jetified-braintree-3.21.1-runtime (com.braintreepayments.api:braintree:3.21.1) and jetified-braintree-core-4.31.0-runtime (com.braintreepayments.api:braintree-core:4.31.0)
     Duplicate class com.braintreepayments.api.DataCollector found in modules jetified-braintree-3.21.1-runtime (com.braintreepayments.api:braintree:3.21.1) and jetified-data-collector-4.31.0-runtime (com.braintreepayments.api:data-collector:4.31.0)

I've tried changing my dependencies based on the suggestions provided by @Jigs6720 and @mgdeveloper7 but still encounter the same issue.

Is anyone else facing a similar issue or have a working solution for this? Any guidance would be much appreciated.

Thank you.

Bob-MYMC commented 1 year ago

@ysudharsono Thanks for the upgrade. After updating the Braintree library, the promise isn't being triggered (neither resolved nor rejected) after the completion of the payment input. The RN version in the project is 0.63.4. However it works well in a new RN project with RN version 0.71.7

Could you please help?

Harisene commented 1 year ago

I too got this problem in Google and updated the library to the latest. But now I'm getting this error when building the app.

react-native-braintree-dropin-ui/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java:41: error: lambda expressions are not supported in -source 7 callback -> { ^ (use -source 8 or higher to enable lambda expressions) 1 error

I have OpenJDK 11 installed. Can someone help me with this? Cheers!

Bob-MYMC commented 1 year ago

I too got this problem in Google and updated the library to the latest. But now I'm getting this error when building the app.

react-native-braintree-dropin-ui/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java:41: error: lambda expressions are not supported in -source 7 callback -> { ^ (use -source 8 or higher to enable lambda expressions) 1 error

I have OpenJDK 11 installed. Can someone help me with this? Cheers!

@Harisene please try this solution https://github.com/wgltony/react-native-braintree-dropin-ui/issues/111

Harisene commented 1 year ago

Earlier I was getting these two issues from Google.

SPLIT_BUNDLE 1691611302: :
SDK: Braintree Payments com.braintreepayments.api:data-collector (consider upgrading to version 4.31.0)
SPLIT_BUNDLE 1693378699: :
SDK: Braintree Payments com.braintreepayments.api:data-collector (consider upgrading to version 4.31.0)

Then I updated the react-native-braintree-dropin-ui to 1.1.5 and added implementation 'com.braintreepayments.api:data-collector:4.31.0' to the app/build.gradle file and sent a new build to Google.

Now I'm getting this issue no matter what change I make.

SPLIT_BUNDLE 1691611302: :
SDK: Braintree Payments com.braintreepayments.api:data-collector (consider upgrading to version 4.31.0)

Does anyone have any solution for this?

Harisene commented 1 year ago

Hi @ysudharsono how did you update Android SDK to v4?

Harisene commented 1 year ago

Hi, @mgdeveloper7 Could you please explain in detail what did you do to fix this issue and the version of the package you are using? Cheers!

mgdeveloper7 commented 1 year ago

Hi, @mgdeveloper7 Could you please explain in detail what did you do to fix this issue and the version of the package you are using? Cheers!

Hi Harisene,

I was using react-native-braintree-dropin-ui, version 1.1.5. React-Native version 0.72.4

I only changed the following line in my android/app/build.gradle, updated from 6.9.0 to 6.11.0

implementation 'com.braintreepayments.api:drop-in:6.11.0'

After recompiling, the dependency file, com.braintreepayments.api:data-collector automatically got raised to a version above 4.31.0, which is what I wanted. The app worked fine after that and Google accepted the submission.

Hope that helps.

Mangat0702 commented 1 year ago

Hi @mgdeveloper7 @ysudharsono @pckz @Harisene @Bob-MYMC

i am using react-native-braintree-dropin-ui, version 1.1.7. react native version "0.65.1"

buildToolsVersion = "33.0.1" minSdkVersion = 23 compileSdkVersion = 33 targetSdkVersion = 33 ndkVersion = "21.4.7075529"

I am successfully able to open braintree Drop in Ui but after selecting saved card or added new card dropIn UI just hides nothing happened after that.It neither goes to then and nor to catch. it is happening only for android and for ios it is working fine. onDropInSuccess and onDropInFailure methods in library is not working.

can you please help me in this ?

Harisene commented 12 months ago

Hi @Mangat0702 did you find a solution? I'm also using 1.1.7. No issue so far. Maybe you could try downgrading the version and try it out?

Mangat0702 commented 12 months ago

Hi @Mangat0702 did you find a solution? I'm also using 1.1.7. No issue so far. Maybe you could try downgrading the version and try it out?

Hi @Harisene version 1.1.3 is working fine. 1.1.4, 5, 6 and 1.1.7 not working still facing same issue

Harisene commented 12 months ago

thanks for the reply @Mangat0702 - I will update the thread soon if I experience the same