I know it has been asked too many times here but I can't still resolve the issue. I have tried solutions provided in previous questions but they are not working somehow.
Here's my gradle dependency -
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.facebook.android:facebook-android-sdk:3.22.0'
compile project(':IndicatorLib')
compile 'com.makeramen:roundedimageview:1.5.0'
compile 'com.github.clans:fab:1.5.0'
// GMS in the library was causing merging error, we need to exclude the duplicate dependencies
compile ('io.nlopez.smartlocation:library:3.2.0') { exclude group: 'com.google.android.gms'}
Here's my gradle dependencies output -
_releaseApk - ## Internal use, do not manually configure ##
+--- com.google.code.gson:gson:2.3.1
+--- com.android.support:appcompat-v7:23.1.0
| \--- com.android.support:support-v4:23.1.0
| \--- com.android.support:support-annotations:23.1.0
+--- com.google.android.gms:play-services:8.1.0
| +--- com.google.android.gms:play-services-ads:8.1.0
| | +--- com.google.android.gms:play-services-basement:8.1.0
| | | \--- com.android.support:support-v4:22.2.0 -> 23.1.0 (*)
| | \--- com.google.android.gms:play-services-appindexing:8.1.0
| | \--- com.google.android.gms:play-services-basement:8.1.0 (*)
| +--- com.google.android.gms:play-services-analytics:8.1.0
| | +--- com.google.android.gms:play-services-basement:8.1.0 (*)
| | \--- com.google.android.gms:play-services-ads:8.1.0 (*)
| +--- com.google.android.gms:play-services-appindexing:8.1.0 (*)
| +--- com.google.android.gms:play-services-appinvite:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0
| | \--- com.google.android.gms:play-services-basement:8.1.0 (*)
| +--- com.google.android.gms:play-services-appstate:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-basement:8.1.0 (*)
| +--- com.google.android.gms:play-services-cast:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.android.support:mediarouter-v7:22.2.0
| | \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.0 (*)
| +--- com.google.android.gms:play-services-drive:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-fitness:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-location:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-maps:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-games:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-drive:8.1.0 (*)
| +--- com.google.android.gms:play-services-gcm:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-identity:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-location:8.1.0 (*)
| +--- com.google.android.gms:play-services-maps:8.1.0 (*)
| +--- com.google.android.gms:play-services-measurement:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-analytics:8.1.0 (*)
| +--- com.google.android.gms:play-services-nearby:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-panorama:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-plus:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-safetynet:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-vision:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-wallet:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | +--- com.google.android.gms:play-services-identity:8.1.0 (*)
| | \--- com.google.android.gms:play-services-maps:8.1.0 (*)
| \--- com.google.android.gms:play-services-wearable:8.1.0
| \--- com.google.android.gms:play-services-base:8.1.0 (*)
+--- com.facebook.android:facebook-android-sdk:3.22.0
| +--- com.android.support:support-v4:[21,22) -> 23.1.0 (*)
| \--- com.parse.bolts:bolts-android:1.1.4
+--- project :IndicatorLib
| \--- com.android.support:support-v4:21.0.3 -> 23.1.0 (*)
+--- com.makeramen:roundedimageview:1.5.0
+--- com.github.clans:fab:1.5.0
\--- io.nlopez.smartlocation:library:3.2.0
\--- com.android.support:support-annotations:23.0.1 -> 23.1.0
_releaseCompile - ## Internal use, do not manually configure ##
+--- com.google.code.gson:gson:2.3.1
+--- com.android.support:appcompat-v7:23.1.0
| \--- com.android.support:support-v4:23.1.0
| \--- com.android.support:support-annotations:23.1.0
+--- com.google.android.gms:play-services:8.1.0
| +--- com.google.android.gms:play-services-ads:8.1.0
| | +--- com.google.android.gms:play-services-basement:8.1.0
| | | \--- com.android.support:support-v4:22.2.0 -> 23.1.0 (*)
| | \--- com.google.android.gms:play-services-appindexing:8.1.0
| | \--- com.google.android.gms:play-services-basement:8.1.0 (*)
| +--- com.google.android.gms:play-services-analytics:8.1.0
| | +--- com.google.android.gms:play-services-basement:8.1.0 (*)
| | \--- com.google.android.gms:play-services-ads:8.1.0 (*)
| +--- com.google.android.gms:play-services-appindexing:8.1.0 (*)
| +--- com.google.android.gms:play-services-appinvite:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0
| | \--- com.google.android.gms:play-services-basement:8.1.0 (*)
| +--- com.google.android.gms:play-services-appstate:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-basement:8.1.0 (*)
| +--- com.google.android.gms:play-services-cast:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.android.support:mediarouter-v7:22.2.0
| | \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.0 (*)
| +--- com.google.android.gms:play-services-drive:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-fitness:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-location:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-maps:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-games:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-drive:8.1.0 (*)
| +--- com.google.android.gms:play-services-gcm:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-identity:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-location:8.1.0 (*)
| +--- com.google.android.gms:play-services-maps:8.1.0 (*)
| +--- com.google.android.gms:play-services-measurement:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | \--- com.google.android.gms:play-services-analytics:8.1.0 (*)
| +--- com.google.android.gms:play-services-nearby:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-panorama:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-plus:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-safetynet:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-vision:8.1.0
| | \--- com.google.android.gms:play-services-base:8.1.0 (*)
| +--- com.google.android.gms:play-services-wallet:8.1.0
| | +--- com.google.android.gms:play-services-base:8.1.0 (*)
| | +--- com.google.android.gms:play-services-identity:8.1.0 (*)
| | \--- com.google.android.gms:play-services-maps:8.1.0 (*)
| \--- com.google.android.gms:play-services-wearable:8.1.0
| \--- com.google.android.gms:play-services-base:8.1.0 (*)
+--- com.facebook.android:facebook-android-sdk:3.22.0
| +--- com.android.support:support-v4:[21,22) -> 23.1.0 (*)
| \--- com.parse.bolts:bolts-android:1.1.4
+--- project :IndicatorLib
| \--- com.android.support:support-v4:21.0.3 -> 23.1.0 (*)
+--- com.makeramen:roundedimageview:1.5.0
+--- com.github.clans:fab:1.5.0
\--- io.nlopez.smartlocation:library:3.2.0
\--- com.android.support:support-annotations:23.0.1 -> 23.1.0
From what I think, smartlocation
library is the main culprit which is causing the issue since if I remove this library, the app is building correctly. According to the build.gradle of the library, the only thing I think which can conflict is GMS
library, for which I have added exclude but this is also giving the same error. What else can I do to resolve the problem?
Update :-
Here's the error log -
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
F:\Android SDK\build-tools\21.1.2\dx.bat --dex --no-optimize --output F:\Android Projects\Office Projects\Git Synced\new\app\build\intermediates\dex\debug --input-list=F:\Android Projects\Office Projects\Git Synced\new\app\build\intermediates\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
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)