9

在此处输入图像描述我正在集成BraintreeDrop-in UI,但我的项目没有被编译。我使用了以下依赖项:-

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

3 回答 3

18

把这个加在你身上Project.gradle

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

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

希望这会有所帮助!

于 2020-02-07T12:37:48.953 回答
12

请更新下面的凭据和 URL,build.gradle(App Level)因为最新的 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

于 2021-07-06T15:43:12.823 回答
3

在你的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

于 2020-03-18T18:22:43.577 回答