Reputation: 2604
I am receiving the below error when i add picasso to the dependencies and i can't find out what how to fix it. please any help would be appreciated. i tried cleaning, rebuilding the project and got no error but when running the project, the error shows up.
app gradle:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile project(':library')
compile 'com.mobprofs:retrofit-simplexmlconverter:1.1'
compile 'rubygems:json:1.8.0'
compile 'org.eclipse.birt.runtime.3_7_1:org.apache.commons.codec:1.3.0'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'it.sephiroth.android.library.picasso:picasso:2.5.2.3'
loader:1.9.4' }
Information:Gradle tasks [:app:assembleDebug] :app:preBuild :app:compileDebugNdk UP-TO-DATE :app:preDebugBuild :app:checkDebugManifest :app:preReleaseBuild :library:compileLint :library:copyReleaseLint UP-TO-DATE :library:mergeReleaseProguardFiles UP-TO-DATE :library:preBuild :library:preReleaseBuild :library:checkReleaseManifest :library:prepareReleaseDependencies :library:compileReleaseAidl UP-TO-DATE :library:compileReleaseRenderscript UP-TO-DATE :library:generateReleaseBuildConfig UP-TO-DATE :library:generateReleaseAssets UP-TO-DATE :library:mergeReleaseAssets UP-TO-DATE :library:generateReleaseResValues UP-TO-DATE :library:generateReleaseResources UP-TO-DATE :library:packageReleaseResources UP-TO-DATE :library:processReleaseManifest UP-TO-DATE :library:processReleaseResources UP-TO-DATE :library:generateReleaseSources UP-TO-DATE :library:compileReleaseJava UP-TO-DATE :library:processReleaseJavaRes UP-TO-DATE :library:packageReleaseJar UP-TO-DATE :library:compileReleaseNdk UP-TO-DATE :library:packageReleaseJniLibs UP-TO-DATE :library:packageReleaseLocalJar UP-TO-DATE :library:packageReleaseRenderscript UP-TO-DATE :library:bundleRelease UP-TO-DATE :app:prepareComAmulyakhareComAmulyakhareTextdrawable101Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72210Library UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWearable750Library UP-TO-DATE :app:prepareComJpardogoMaterialtabstripLibrary110Library UP-TO-DATE :app:prepareComPkmmteViewCircularimageview11Library UP-TO-DATE :app:prepareProjectOneLibraryUnspecifiedLibrary UP-TO-DATE :app:prepareItSephirothAndroidLibraryPicassoPicasso2523Library 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:compileDebugJava Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. :app:preDexDebug :app:dexDebug UNEXPECTED TOP-LEVEL EXCEPTION: Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\RZahr\AppData\Local\AndroidStudio\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output D:\AndroidStudioProjects\ProjectOne\app\build\intermediates\dex\debug --input-list=D:\AndroidStudioProjects\ProjectOne\app\build\intermediates\tmp\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)
gradle console error:
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)
FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\RZahr\AppData\Local\AndroidStudio\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output D:\AndroidStudioProjects\ProjectOne\app\build\intermediates\dex\debug --input-list=D:\AndroidStudioProjects\ProjectOne\app\build\intermediates\tmp\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)
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Upvotes: 1
Views: 923
Reputation: 907
Check the different libraries you have added to make sure they don't have colliding dependencies or that the libraries are correctly aded.
i have :
compile 'com.squareup.picasso:picasso:2.+'
to manually disable colliding library modules,follow this example :
compile ('com.facebook.android:facebook-android-sdk:3.22.0@aar'){
exclude module: 'support-v4'
}
EDIT
The case may be, also, that you have ran out of methods. yes, this can happen, don't worry! what you have to do is enable multidexing, also known as, enabling your android build engine to ignore the 65k methods limit and build more method files.
the steps are described here :
https://developer.android.com/tools/building/multidex.html
but i'll make a small resume.
you have to add this dependency :
compile 'com.android.support:multidex:1.0.0'
and this line to your manifest:
<application
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>
finally, on your build.gradle file, you have to setup this configuration setting:
defaultConfig {
...(your settings)
// Enabling multidex support.
multiDexEnabled true
}
Upvotes: 1