braintree / braintree-android-drop-in

Braintree Drop-In SDK for Android
https://developers.braintreepayments.com/guides/drop-in/android/v2
MIT License
124 stars 79 forks source link

Update braintree_android to 4.33.0 #424

Closed khushboo18 closed 1 year ago

khushboo18 commented 1 year ago

Thank you for your contribution to Braintree.

Before submitting this PR, note that we cannot accept language translation PRs. We support the same languages that are supported by PayPal, and have a dedicated localization team to provide the translations. If there is an error in a specific translation, you may open an issue and we will escalate it to the localization team.

Summary of changes

Authors

List GitHub usernames for everyone who contributed to this pull request.

khushboo18 commented 1 year ago

Seeing some failures while running rake locally but all those failures are seen on master as well.

Would appreciate any guidance around what else needs to be updated with this version bump!

sshropshire commented 1 year ago

@khushboo18 which Rake task are you running and seeing errors for?

khushboo18 commented 1 year ago

@sshropshire I'm just trying to run rake as suggested in the Development guidelines. How do I check if I need to make any more changes/updates in this PR?

jaxdesmarais commented 1 year ago

I just approved and ran CI on this branch and unit_tests are passing which means the failure are likely in the integration_tests when running rake. Are you able to share the specific integration test that are failing for you locally?

khushboo18 commented 1 year ago

@jaxdesmarais thanks! This is what some of the failure look like -

/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInActivity.java:294: Error: AuthorizationCallback can only be accessed from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
        dropInInternalClient.getAuthorization(new AuthorizationCallback() {
                                                  ~~~~~~~~~~~~~~~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInActivity.java:296: Error: AuthorizationCallback.onAuthorizationResult can only be called from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
            public void onAuthorizationResult(@Nullable Authorization authorization, @Nullable Exception authorizationError) {
                        ~~~~~~~~~~~~~~~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInActivityResultContract.java:28: Error: Authorization.toString can only be called from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
                .putExtra(EXTRA_AUTHORIZATION, input.getAuthorization().toString());
                                                                        ~~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInActivityResultContract.java:39: Error: UserCanceledException can only be called from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
            userCanceledResult.setError(new UserCanceledException("User canceled DropIn."));
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInClient.java:44: Error: IntegrationType.DROP_IN can only be accessed from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
            braintreeClient = new BraintreeClient(context, clientTokenProvider, null, IntegrationType.DROP_IN);
                                                                                                      ~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInClient.java:46: Error: IntegrationType.DROP_IN can only be accessed from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
            braintreeClient = new BraintreeClient(context, authorization, null, IntegrationType.DROP_IN);
                                                                                                ~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInClient.java:199: Error: BraintreeClient.getAuthorization can only be called from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
        braintreeClient.getAuthorization(callback);
                        ~~~~~~~~~~~~~~~~
/braintree-android-drop-in/Drop-In/src/main/java/com/braintreepayments/api/DropInClient.java:213: Error: BraintreeClient.getSessionId can only be called from within the same library group (referenced groupId=com.braintreepayments.api from groupId=braintree-android-drop-in) [RestrictedApi]
                            new DropInIntentData(dropInRequest, authorization, braintreeClient.getSessionId());

...

And these same failures are showing on master so maybe something wrong with my local env?

sshropshire commented 1 year ago

@khushboo18 I'm not seeing this error on my machine, but I can see how this error may be thrown I'm surprised this hasn't occurred before.

We do have some classes in our Core SDK annotated with @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) to discourage use by merchants. Technically it should be fine since DropIn also has a group ID of com.braintreepayments.api when we deploy to maven central.

Which version of Android Studio are you using? And also what version of the JDK are you using to build?

khushboo18 commented 1 year ago

@sshropshire I'm not using Android Studio for this, I was just running it from my terminal.

openjdk version "11.0.16.1" 2022-07-19 LTS
OpenJDK Runtime Environment Zulu11.58+23-CA (build 11.0.16.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu11.58+23-CA (build 11.0.16.1+1-LTS, mixed mode)

Will run it on android studio and update

Update: same failure on android studio as well, version Android Studio Electric Eel | 2022.1.1 Patch 1

sshropshire commented 1 year ago

Ok I'm using the same 2022.2.1 Android Studio version. Can you try it with JDK 17 for good measure?

khushboo18 commented 1 year ago

Gave that a try, same errors with JDK version "17.0.7". @sshropshire if its passing for you locally and all the unit tests are passing on CI, could we go ahead and merge this? Something could just be wrong with my local environment since I'm seeing the same issues on master as well.

sshropshire commented 1 year ago

@khushboo18 I can give it a 👍 once CI passes. We can wait on the other 👍 and merge.