Я пытаюсь скомпилировать свой проект в Android Studio и получаю эту ошибку, я знаю, что из-за какой-либо зависимости дублируется библиотека support-v4, но я не могу это исправить.
Program type already present: android.support.v4.widget.SlidingPaneLayout$PanelSlideListener
Вот мой build.gradle.Библиотека скользящего меню зависит только от support-v4, но я не могу удалить эту зависимость, так как появляется много ошибок.
apply plugin: 'com.android.application'
buildscript{
repositories {
//maven { url "https://maven.google.com" } // Gradle < 4.0
mavenCentral()
jcenter()
//google()
}
allprojects {
repositories {
mavenCentral() // Add following
jcenter()
}
}
dependencies {
classpath "com.android.tools.build:gradle:3.1.3"
}
}
dependencies {
//implementation fileTree(include: '*.jar', dir: 'libs')
implementation files('libs/wekaSTRIPPED.jar')
implementation files('libs/pad.jar')
implementation files('libs/javacsv.jar')
implementation files('libs/extras.jar')
//implementation (group: 'net.sourceforge.javacsv', name: 'javacsv', version: '2.0'){
//exclude group: 'com.google.android', module: 'support-v4'
//}
implementation 'com.android.support:support-compat:27.1.1'
implementation 'com.android.support:multidex:1.0.0'
implementation('com.android.support:appcompat-v7:27.1.1'){
exclude group: 'com.android.support', module: 'appcompat-v4'
}
//implementation('com.android.support:design:27.1.1') {
// exclude group: 'com.android.support'
//exclude module: 'appcompat-v7'
//exclude module: 'support-v4'
//exclude module: 'appcompat-v4'
//}
implementation project(':SlidingMenu')
implementation ('com.google.code.gson:gson:2.2.2'){
exclude group: 'com.google.android', module: 'support-v4'
exclude group: 'com.google.android', module: 'appcompat-v4'
}
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
multiDexEnabled true
}
configurations.all {
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
}
android {
buildToolsVersion '27.0.3'
}
repositories {
google()
}
Спасибо за поддержку.