Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (**com.android.support:support-compat:27.1.1**) and classes.jar (**com.android.support:support-v4:22.2.0**)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (com.android.support:support-compat:27.1.1) and classes.jar (com.android.support:support-v4:22.2.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (com.android.support:support-compat:27.1.1) and classes.jar (com.android.support:support-v4:22.2.0)
Duplicate class android.support.v4.app.ListFragment found in modules classes.jar (com.android.support:support-fragment:27.1.1) and classes.jar (com.android.support:support-v4:22.2.0)
Duplicate class android.support.v4.app.ListFragment$1 found in modules classes.jar (com.android.support:support-fragment:27.1.1) and classes.jar (com.android.support:support-v4:22.2.0)
Duplicate class android.support.v4.app.ListFragment$2 found in modules classes.jar (com.android.support:support-fragment:27.1.1) and classes.jar (com.android.support:support-v4:22.2.0)
Duplicate class android.support.v4.app.LoaderManager found in modules classes.jar (com.android.support:support-fragment:27.1.1) and classes.jar (com.android.support:support-v4:22.2.0)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.tototita.cxensetestapp"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//**CXsense
implementation 'com.cxpublic:cxense-android:1.0.1'
}
如何避免Cxense SDK中肯定包含的重复类?
有两种方法可以解决问题。
>
在实现
时单独排除重复的依赖项,
以泛型方式从每个实现
中排除重复的依赖项。
在这里,在您的例子中,工件com.android.support
是重复的,因为您的应用程序模块使用版本:27.1.1,而工件com.cxpublic:cxense-Android:1.0.1
具有com.android.support
的内部依赖性,使用版本:22.2.0。
因此,您应该手动删除其中一个(建议删除较旧或较低的版本)。我们试着把它移除!
implementation ('com.cxpublic:cxense-android:1.0.1') {
exclude group: "com.android.support", module: "support-v4"
}
当我们在此工件上使用实现时,将exclude for groupcom.android.support
放入工件com.cxpublic:cxense-Android:1.0.1
中,将不会为support-v4
库导入。
因此,问题可以通过手动将此块放置到每个有此冲突的工件中来解决。
第二种方式:
android {
// Some other stuffs
configurations {
all*.exclude module: 'support-v4' // This removes all other versions of `support-v4` if gets duplicated from all the artifacts.
}
// Rest of other stuffs
}
我添加了一个dialogflow库,并出现此错误。 Github上的文件
我正在开发一个新闻应用程序,但我从gradle控制台得到以下错误 在我的app.gradle下面
但问题是我不能完全排除它。如果我这样做了,我的应用程序将编译,但一旦需要调用Firestore就会崩溃。只要我的应用程序启动。 我就是不明白。
重复类android。支持v4。应用程序。在模块类中找到INotificationSideChannel。jar(androidx.core:core:1.1.0)和类。jar(com.android.support:support-v4:23.4.0)
如何实现类?