# Duplicate classes in com.nimbusds:nimbus-jose-jwt and in-app-payments-sdk on Android

**URL:** <https://developer.squareup.com/forums/t/duplicate-classes-in-com-nimbusds-nimbus-jose-jwt-and-in-app-payments-sdk-on-android/7143>\
**Category:** Questions\
**Tags:** in-app-payments-sdk\
**Created:** [September 22, 2022, 3:51am UTC](https://developer.squareup.com/forums/t/duplicate-classes-in-com-nimbusds-nimbus-jose-jwt-and-in-app-payments-sdk-on-android/7143 "2022-09-22T03:51:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![perqin](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/perqin/32/1463_2.png) [@perqin](https://developer.squareup.com/forums/u/perqin)\
**Post date:** [September 22, 2022, 3:51am UTC](https://developer.squareup.com/forums/t/duplicate-classes-in-com-nimbusds-nimbus-jose-jwt-and-in-app-payments-sdk-on-android/7143/1 "2022-09-22T03:51:22Z")

</div>

When integrating Square’s React Native In App Payments SDK, I got the duplicate class build error on Android. Those classes are found in com.nds.threeds:threedssdk-release (transitive dependency of com.squareup.sdk.in-app-payments:buyer-verification) and com.nimbusds:nimbus-jose-jwt (transitive dependency of our app).  
I guess that the nimbus-jose-jwt library is packaged into the threedssdk-release library. Would you guys consider pulling it out and making threedssdk-release depend on nimbus-jose-jwt library instead?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [September 26, 2022, 8:03pm UTC](https://developer.squareup.com/forums/t/duplicate-classes-in-com-nimbusds-nimbus-jose-jwt-and-in-app-payments-sdk-on-android/7143/2 "2022-09-26T20:03:26Z")

</div>

According to the team we can’t pull out `nimbus-jose-jwt`. Instead you can try to remove transitive dependency and rely on the version shipped. But there’s a chance that version won’t match. Still worth a try according to the team. Excluding transitive dependency on nimbus can be done like this:

```auto
implementation("com.something:dependency-with-transitive-nimbusds:1.0.0") {
  exclude group: 'com.nimbusds', module: 'nimbus-jose-jwt'
}

```

🙂

---

<div class="post-metadata">

**Author:** ![perqin](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/perqin/32/1463_2.png) [@perqin](https://developer.squareup.com/forums/u/perqin)\
**Post date:** [September 27, 2022, 7:13am UTC](https://developer.squareup.com/forums/t/duplicate-classes-in-com-nimbusds-nimbus-jose-jwt-and-in-app-payments-sdk-on-android/7143/3 "2022-09-27T07:13:41Z")

</div>

This could be an option, but I still have some questions. Which exact version is packaged into threedssdk-release? And I found that some classes are missing in the packaged version, after inspecting the classes.jar in threedssdk-release and nimbus-jose-jwt. This may lead to some problem 😨.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [September 27, 2022, 6:44pm UTC](https://developer.squareup.com/forums/t/duplicate-classes-in-com-nimbusds-nimbus-jose-jwt-and-in-app-payments-sdk-on-android/7143/4 "2022-09-27T18:44:29Z")

</div>

Another option is to download `threedssdk-release` aar, remove the `nimbus` classes from the `classes.jar` inside of it, them package it back as `aar` and use it; while also depending on the `nimbus` library yourself. Theoretically this might work and threeds sdk will just use the dependency provided by developers instead of the packaged one.

The one thing you need to be aware of is that there’s not guarantee that buyer verification will still work. 🙂
