Braintree Drop-in UI: ERROR: Failed to resolve: org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.1-2?

11.7k views Asked by At

enter image description hereI am integrating Braintree Drop-in UI but my project is not getting compiled.. I have used below dependency:-

implementation 'com.braintreepayments.api:drop-in:4.5.0'
3

There are 3 answers

0
Rahul Gaur On BEST ANSWER

Add this in you Project.gradle

rootProject.allprojects {
    repositories {
        maven {
            url  "https://cardinalcommerce.bintray.com/android"
            credentials {
                username 'braintree-team-sdk@cardinalcommerce'
                password '220cc9476025679c4e5c843666c27d97cfb0f951'
            }
        }
    }
}

You can also read more about this error here

Hope this will help!

0
Nik On

In your project.gradle

repositories {
    maven {
        url "https://cardinalcommerce.bintray.com/android"
        credentials {
            username 'braintree_team_sdk'
            password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
        }
    }
}

If you're using the Google Play Services Gradle plugin, you will also need to add this to your build.gradle to avoid a dependency resolution issue:

dependencies {
    // Your dependency declarations...
    components.all {
        allVariants {
            withDependencies { deps ->
                deps.each { dep ->
                    if (dep.group == 'net.minidev' && dep.name =='json-smart') {
                            dep.version {
                                prefer "2.3"
                            }
                            dep.because "resolving dependencies issue"
                    }
                }
            }
        }
    }
}

For more info: https://developers.braintreepayments.com/guides/3d-secure/client-side/android/v3#generate-a-client-token

0
MashukKhan On

Please update below credentials and url in build.gradle(App Level) as of latest Braintree credentials have been updated.

Old Credentials

url  "https://cardinalcommerce.bintray.com/android"
username 'braintree-team-sdk@cardinalcommerce'
password '220cc9476025679c4e5c843666c27d97cfb0f951'

New Credentials

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
            credentials {
                username 'braintree_team_sdk'
                password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
            }
        }
    }
}

As per @Nik's answer If you're using the Google Play Services Gradle plugin, you will also need to add this to your build.gradle to avoid a dependency resolution issue:

components.all {
    allVariants {
        withDependencies { deps ->
            deps.each { dep ->
                if (dep.group == 'net.minidev' && dep.name =='json-smart') {
                    dep.version {
                        prefer "2.3"
                    }
                    dep.because "resolving dependencies issue"
                }
            }
        }
    }
}

For more info: https://developer.paypal.com/braintree/docs/guides/3d-secure/client-side/android/v3#generate-a-client-token

Related Git Thread regarding:

Unsafe implementation of the HostnameVerifier interface - Google policy violation

https://github.com/braintree/braintree-android-drop-in/issues/219

https://github.com/braintree/braintree-android-drop-in/issues/208