square / in-app-payments-react-native-plugin

Apache License 2.0
119 stars 50 forks source link

Duplicate class conflict with react-native-code-push #62

Closed DChiuch closed 4 years ago

DChiuch commented 4 years ago

I'm getting these errors when I have both react-native-square-in-app-payments and react-native-code-push installed:

`Execution failed for task ':app:checkDebugDuplicateClasses'.

1 exception was raised by workers: java.lang.RuntimeException: Duplicate class com.nimbusds.jose.JWEObject found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.JWEObject$State found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.JWSObject found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.JWSObject$State found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.Payload found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.Payload$Origin found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.Requirement found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.crypto.AESEncrypter found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.crypto.AESEncrypter$AlgFamily found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1) Duplicate class com.nimbusds.jose.jwk.KeyOperation found in modules jetified-threedssdk-release-1.1.17-runtime.jar (com.nds.threeds:threedssdk-release:1.1.17) and nimbus-jose-jwt-5.1.jar (com.nimbusds:nimbus-jose-jwt:5.1)`

DChiuch commented 4 years ago

This appears to work as a temporary measure:

In ./node_modules/react-native-square-in-app-payments/android/build.gradle

Replace

implementation "com.squareup.sdk.in-app-payments:buyer-verification:$sqipVersion"

With

compile ("com.squareup.sdk.in-app-payments:buyer-verification:$sqipVersion") {
    exclude group: 'com.nds.threeds', module: 'threedssdk-release'
}
cnuss commented 4 years ago

Any fixes found for this outside of changing the build.gradle file?

ac130kz commented 4 years ago

Had the exact same problem with https://github.com/DeligenceTechnologies/Braintree-Payment-Gateway-for-Flutter. Solved it with:

configurations {
    implementation {
        exclude group: 'com.nds.threeds', module: 'threedssdk-release'
    }
}
DChiuch commented 4 years ago

Had the exact same problem with https://github.com/DeligenceTechnologies/Braintree-Payment-Gateway-for-Flutter. Solved it with:

configurations {
    implementation {
        exclude group: 'com.nds.threeds', module: 'threedssdk-release'
    }
}

That works for me.

NguyenLuongVinh commented 3 years ago

Had the exact same problem with https://github.com/DeligenceTechnologies/Braintree-Payment-Gateway-for-Flutter. Solved it with:

configurations {
    implementation {
        exclude group: 'com.nds.threeds', module: 'threedssdk-release'
    }
}

Thanks you, that work for me :D

LukhiKartik commented 3 years ago

I have added below code in build.gradle and i am able to create build but app get crash on save button when using buyer verification flow. https://github.com/square/in-app-payments-react-native-plugin/issues/137

configurations { implementation { exclude group: 'com.nds.threeds', module: 'threedssdk-release' } }