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

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

我正在集成 Braintree Drop-in UI 但我的项目没有被编译.. 我使用了以下依赖项:-

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

把这个加在你身上Project.gradle

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

您还可以阅读有关此错误的更多信息here

希望这会有所帮助!

在你的project.gradle

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

如果您使用的是 Google Play Services Gradle 插件,您还需要将其添加到 build.gradle 以避免依赖项解析问题:

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"
                    }
                }
            }
        }
    }
}

更多信息: https://developers.braintreepayments.com/guides/3d-secure/client-side/android/v3#generate-a-client-token

请更新以下凭据,build.gradle(App Level) 中的 url 已更新最新的 Braintree 凭据。

旧凭证

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

新凭据

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

根据@Nik 的回答 如果您使用的是 Google Play Services Gradle 插件,您还需要将此添加到 build.gradle 以避免依赖项解析问题:

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"
                }
            }
        }
    }
}

更多信息:https://developer.paypal.com/braintree/docs/guides/3d-secure/client-side/android/v3#generate-a-client-token

相关 Git 主题涉及:

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