Moving the dependencies further backwards from Smack 4.1.3 to Smack 4.1.1 gives the following error on Gradle build
AGPBI: {“kind”:“SIMPLE”,“text”:“com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;”,“position”:{},“origin al”:“com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;”}
The dependencies follow the ones in Smack 4.1 Readme files exactly (Smack 4.1 Readme and Upgrade Guide · igniterealtime/Smack Wiki · GitHub - using Eclipse section) as follows
dependencies {
compile fileTree(include: [‘*.jar’], dir: ‘libs’)
compile(‘org.igniterealtime.smack:smack-android:4.1.1’)
compile(‘org.igniterealtime.smack:smack-android-extensions:4.1.1’)
compile(‘org.igniterealtime.smack:smack-core:4.1.1’)
compile(‘org.igniterealtime.smack:smack-tcp:4.1.1’)
compile(‘org.igniterealtime.smack:smack-extensions:4.1.1’)
compile(‘org.igniterealtime.smack:smack-experimental:4.1.1’)
compile(‘org.igniterealtime.smack:smack-resolver-minidns:4.1.1’)
compile(‘org.igniterealtime.smack:smack-sasl-provided:4.1.1’)
compile(‘org.igniterealtime.smack:smack-im:4.1.1’)
compile(‘org.jxmpp:jxmpp-core:0.4.2-beta1’)
compile(‘org.jxmpp:jxmpp-util-cache:0.4.2-beta1’)
compile(‘de.measite.minidns:minidns:0.1.1’)
compile ‘com.android.support:appcompat-v7:22.2.0’
}
}
This produces a compilation error revolving around
AGPBI: {“kind”:“SIMPLE”,“text”:“com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;”,“position”:{},“origin al”:“com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;”}
Error details from the Gradle build message and Gradle console are as listed below –
Gradle build messages
Information:Gradle tasks [:app:assembleDebug]
Warning:Dependency xpp3:xpp3:1.1.4c is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency xpp3:xpp3:1.1.4c is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ‘:app:dexDebug’.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘D:\Java\JDK\bin\java.exe’’ finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 2.044 secs
Information:1 error
Information:2 warnings
Information:See complete output in console
Gradle output console
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
WARNING: Dependency xpp3:xpp3:1.1.4c is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency xpp3:xpp3:1.1.4c is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
AGPBI: {“kind”:“SIMPLE”,“text”:“UNEXPECTED TOP-LEVEL EXCEPTION:”,“position”:{},“original”:“UNEXPECTED TOP-LEVEL EXCEPTION:”}
AGPBI: {“kind”:“SIMPLE”,“text”:“com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;”,“position”:{},“origin al”:“com.android.dex.DexException: Multiple dex files define Lorg/jivesoftware/smack/android/AndroidSmackInitializer;”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)”,“position “:{},“original”:”\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)”,“position”:{ },“original”:“\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)”,“position”:{ },“original”:“\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)”,“position”:{},“o riginal”:“\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:189)”,“position”:{},“origin al”:“\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:189)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)”,“posit ion”:{},“original”:“\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)”,“position”:{},“ori ginal”:“\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.command.dexer.Main.run(Main.java:246)”,“position”:{},“original”: “\tat com.android.dx.command.dexer.Main.run(Main.java:246)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.command.dexer.Main.main(Main.java:215)”,“position”:{},“original” :“\tat com.android.dx.command.dexer.Main.main(Main.java:215)”}
AGPBI: {“kind”:“SIMPLE”,“text”:“\tat com.android.dx.command.Main.main(Main.java:106)”,“position”:{},“original”:“\tat com.android.dx.command.Main.main(Main.java:106)”}
FAILED
FAILURE: Build failed with an exception.
Execution failed for task ‘:app:dexDebug’.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘D:\Java\JDK\bin\java.exe’’ finished with non-zero exit value 2
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.044 secs
How do I resolve the duplication error - do I need to remove any of the dependencies suggested by Smack 4.1 Readme file - which dependency should be removed?
Thanks