android - 依赖解析错误?科特林
问题描述
我得到了这个错误,我不知道如何解决它。
这些是我在应用程序中的依赖项
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'com.google.firebase:firebase-database-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation platform('com.google.firebase:firebase-bom:28.4.1')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation ('com.google.zxing:core:3.3.3')
implementation 'com.braintreepayments.api:drop-in:3.3.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.loopj.android:android-async-http:1.4.9'
}
请帮我解决这个错误?
已编辑
我更改了 minsdk 版本,但它显示了另一个错误,还添加了类似此错误的 uses-sdk 工具,但得到了同样的错误。
解决方案
当您添加两个包含相同类的依赖项时,会出现此问题。而且我认为被告应该是这种braintreepayments
依赖,所以我建议更新
implementation 'com.braintreepayments.api:drop-in:3.3.0'
更新版本
implementation 'com.braintreepayments.api:drop-in:5.2.2'
当然,您已经将 mven repo 添加到您的项目 gradle 文件中。
repositories {
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
username 'braintree_team_sdk'
password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
}
}
}
更多信息,请查看: https ://github.com/braintree/braintree-android-drop-in
已编辑
不要忘记设置 min sdk 版本 21 或以上
defaultConfig {
...
minSdkVersion 21
...
}
如果清单中存在,则删除此行
<uses-sdk android:minSdkVersion="16"/>
推荐阅读
- r - 使用二进制变量进行聚类
- c++ - 以 std::async 开始的函数在经过多次迭代后崩溃
- php - 基于关系获取集合中 Laravel 模型的列表和计数
- php - 在php中按姓氏对多维数组进行排序
- firebird - 在文本中发现无效字符
- angular - Angular 7 路由在 IE11 上无法正常工作
- swift - 在不使用 CGWindowListCreateImage 函数的情况下将桌面捕获为图像
- xslt - 只有 name 属性的 xsl:template 和 xsl:function 有什么区别
- dart - 隔离的端口发送消息是否使用套接字?
- java - AppEngine Java8 应用缺少 appengine-api-1.0