android - 如何修复重复类 org.jetbrains.annotations.TestOnly 错误?
问题描述
我收到很多这样的错误:Duplicate class org.jetbrains.annotations.TestOnly found in the following modules:...
这表明我错过了一个排除项,但我的 build.gtadle 中有以下几行
configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
compile.exclude group: 'org.jetbrains.kotlin' , module:'kotlin-stdlib'
compile.exclude group: 'com.intellij', module:'annotations'
}
那么缺少什么?
编辑:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//Firebase
implementation ("com.google.firebase:firebase-core:17.2.0") {
exclude group: "com.android.support", module: "support-v4"
}
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-plugins:2.0.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-ml-vision:24.0.0'
implementation ("com.google.firebase:firebase-auth:19.1.0") {
exclude group: "com.android.support", module: "support-v4"
}
implementation 'com.google.firebase:firebase-database:19.1.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
//Graphview
implementation 'com.jjoe64:graphview:4.2.1'
implementation 'org.apache.commons:commons-lang3:3.4'
//Google Play
implementation ("com.google.android.gms:play-services-base:17.1.0") {
exclude group: "com.android.support", module: "support-v4"
}
implementation "com.google.android.gms:play-services-auth:17.0.0"
implementation "com.google.android.gms:play-services-identity:17.0.0"
//FirebaseUI
implementation 'com.firebaseui:firebase-ui-auth:6.0.2'
implementation 'com.firebaseui:firebase-ui-storage:6.0.2'
implementation 'com.facebook.android:facebook-android-sdk:5.8.0'
implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
//Support
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.appcompat:appcompat-resources:1.1.0"
implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
implementation "androidx.drawerlayout:drawerlayout:1.0.0"
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation "androidx.preference:preference:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "io.reactivex.rxjava2:rxjava:2.2.13"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
//Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
/**
* dependency to request the runtime permissions.
*/
implementation 'com.karumi:dexter:4.2.0'
// code generator for view
implementation "com.jakewharton:butterknife:10.2.0"
annotationProcessor "com.jakewharton:butterknife-compiler:10.2.0"
testImplementation 'junit:junit:4.12'
}
所以这是我的依赖项,我没有直接包含这些包,但不知何故,我间接猜测它们。
这似乎是帖子的太多代码,所以我必须添加一些文本
解决方案
从您的依赖项中删除implementation 'com.jjoe64:graphview:4.2.1'
已知会导致重复的类错误。
您还可以使用实现'com.jjoe64:graphview:4.2.2'
推荐阅读
- android - 如何生成随机数,使每个数字只出现一次?
- .net-core-3.1 - 自定义 AuthorizationHandler 中的 ASP.NET Core 3.1 MVC 重定向
- python-3.x - 使用 join 和 /n 解析新行上的数据不起作用
- python - 重塑一个 numpy 数组会导致 TypeError
- arrays - 我在 Flutter 中访问数组值时遇到问题
- javascript - 获取每个 Select 元素的选定值并记录到控制台
- python - 如何使用coverage.py显示函数定义的行号?
- ios - 当我的基于 SwiftUI 的应用程序以横向模式启动时,导航栏上的背景颜色未设置
- azure-logic-apps - Azure Logic App Partition key [X] 对 COsmos Db 无效
- c++ - 如何从可以在所有平台上运行的 C 或 C++ 系统中获取当前本地格式日期