我正在集成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'
}
}
}
}
您还可以在此处阅读有关此错误的更多信息
希望这会有所帮助!
请更新下面的凭据和 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"
}
}
}
}
}
相关的 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
在你的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"
}
}
}
}
}
}