Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

glenn romaniuk
glenn romaniuk
32,520 Points

Android - Self destructing app - Error with parse.com

I ran the android studio quickstep instructions but it runs with the following error:

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Program Files\android-studio\sdk\build-tools\21.0.2\dx.bat --dex --num-threads=4 --output C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\dex\debug C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\classes\debug C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\dependency-cache\debug C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-android-1.3.0-691ea1512b3d1a3818c9a12ec38857fca3733a01.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-applinks-1.3.0-e4b9a049547dbe9ae1e394ddfea6bc57d901359b.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-tasks-1.3.0-5a397e1f698ee4d6aefa8e1a3c03f5eab62ca817.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\Parse-1.11.0-3e4c659383fcb0f9b4968aa011c8710740a39920.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\parse-android-1.11.0-1e98a6aa8e32cd8507f22865ef9b2a757429d9bf.jar Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/parse/AbstractQueryController$1; 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:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) at com.android.dx.command.Main.main(Main.java:106)

glenn romaniuk
glenn romaniuk
32,520 Points

Here's the setup instructions:

https://www.parse.com/apps/quickstart?app_id=ribbit--4694#parse_data/mobile/android/native/existing

here's some additional infor from my gradle console

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature. :app:preBuild :app:compileDebugNdk UP-TO-DATE :app:preDebugBuild :app:checkDebugManifest :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 :app:preDexDebug :app:dexDebug UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lbolts/AggregateException; 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:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) 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:\Program Files\android-studio\sdk\build-tools\21.0.2\dx.bat --dex --num-threads=4 --output C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\dex\debug C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\classes\debug C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\dependency-cache\debug C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-android-1.3.0-691ea1512b3d1a3818c9a12ec38857fca3733a01.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-applinks-1.3.0-e4b9a049547dbe9ae1e394ddfea6bc57d901359b.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-tasks-1.3.0-5a397e1f698ee4d6aefa8e1a3c03f5eab62ca817.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-tasks-1.3.0-c5e0c3be195cc42077f6776006e2331973f17efc.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\bolts-tasks-1.3.0-javadoc-f66ef0e86bd38ca20dd55fba6e74953643387b56.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\Parse-1.11.0-3e4c659383fcb0f9b4968aa011c8710740a39920.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\parse-android-1.11.0-1e98a6aa8e32cd8507f22865ef9b2a757429d9bf.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\ParseFacebookUtilsV3-1.10.3-6ccadb983373c8cdecb7927287533eadd6ac8f34.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\ParseFacebookUtilsV4-1.10.3-850ff46736919f7941e04829c2b23015ca157145.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\ParseInterceptors-0.0.1-c6ad02bb8c8ec976230b4be4769788d9d0a2866c.jar C:\Users\glennr\Dropbox\Android\Ribbit\app\build\intermediates\pre-dexed\debug\ParseTwitterUtils-1.10.3-54397d1d78fb41ca824bf92d24d2a2ffa51c0cb1.jar Error Code: 2 Output:

    UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lbolts/AggregateException; 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:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) 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.

BUILD FAILED

Total time: 7.13 secs

1 Answer

glenn romaniuk
glenn romaniuk
32,520 Points

here's was the solution

i'm following the lesson for eclipse but i'm using android studio it says to drag and drop the parse.jar on the libs folder i did that but it did not behave the same as eclipse i then followed the start instructions from parse which are now not the same as the video thats when all hell broke loose

the solution was the comment the following

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile files('libs/Parse-1.11.0.jar')

compile 'com.parse.bolts:bolts-android:1.+'
//compile 'com.parse:parse-android:1.+'

}