Nachdem ich Graphhoper in mein Projekt eingefügt hatte, sah ich mich mit einem Problem konfrontiert. Ich bin neu in Android, bitte hilf mir. Wie ich verstehe, muss ich diese Klasse aus dem kompilierten Code ausschließen? Aber wie? Wer kann es mir zeigen?Android Studio. Doppelter Eintrag: org/slf4j/helpers/BasicMarker.class
Fehler: Ausführung fehlgeschlagen für Task ': transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/slf4j/helpers/BasicMarker.class
Das ist mein gradle Datei
apply plugin: 'com.android.application'
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.journeyapps:zxing-android-embedded:[email protected]'
compile 'com.google.zxing:core:3.2.0'
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.github.MKergall:osmbonuspack:5.9'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'net.lingala.zip4j:zip4j:1.3.2'
compile('com.graphhopper:graphhopper:0.8-SNAPSHOT') {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'
}
compile 'org.mapsforge:mapsforge-core:0.6.1'
compile 'org.mapsforge:mapsforge-map:0.6.1'
compile 'org.mapsforge:mapsforge-map-android:0.6.1'
compile 'org.mapsforge:mapsforge-map-reader:0.6.1'
/*
compile group: 'org.slf4j', name: 'slf4j-android', version: '1.7.12'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
*/
}
repositories {
jcenter()
}
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
multiDexEnabled true
}
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...
instrumentTest.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')
}
productFlavors {
}
dexOptions {
}
}
apply plugin: 'com.google.gms.google-services'
Vielleicht dieser Beitrag kann helfen Ihnen: http://stackoverflow.com/questions/33831600/gradle-multiple-dependences-require-slf4j – oskarko
Ich habe bereits versucht, aber es hat mir nicht helfen :( –