Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Implementing Designs for Android Adding Push Notifications from Parse.com Setting Up Push Notifications

J Smillie
J Smillie
39,714 Points

I just tried this and now I'm getting an exception in the console when I run. Multiple Dex files...

Here is my error in Android Studio:

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: /Applications/Android Studio.app/sdk/build-tools/android-4.4W/dx --dex --num-threads=4 --output /Users/jonathansmillie/howl/app/build/intermediates/dex/debug /Users/jonathansmillie/howl/app/build/intermediates/classes/debug /Users/jonathansmillie/howl/app/build/intermediates/dependency-cache/debug /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/bolts-android-1.1.2-4bd54e7dac92e511ad104da639fcbde02056b27e.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/bolts-android-1.1.3-3d0b4ec2cf49aac1bd656382f18517ece4c388bf.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/classes-15bfbf0a44053599be299bbf0966e79424a19f94.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/classes-4901322641d7f7cac2184285fcaf9134b235ca0c.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/commons-io-2.4-fbb39ca1430d8b72b3d4b5af20ec4868a5a08282.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/internal_impl-20.0.0-338c57b0f5c6ba04de5d0b3e6968ad36c29d2b5d.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/Parse-1.7.1-db77d84a9d53f5ccb08576f3329cf5661dd463dd.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/picasso-2.3.4-dd92c095b7eb63a9e228d03932b4a86a8ec0c2c7.jar /Users/jonathansmillie/howl/app/build/intermediates/pre-dexed/debug/support-annotations-20.0.0-bca9cd8c8082330ef7549e0398af852faae531fd.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:594) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) at com.android.dx.command.dexer.Main.run(Main.java:230) at com.android.dx.command.dexer.Main.main(Main.java:199) at com.android.dx.command.Main.main(Main.java:103)

I have worked out that there are multiple files defining Lbolts/AggregateException somewhere... but I don't know where...?

Does it have anything to do with the Parse bolts-android-1.1.3.jar library I have included?

Any help would be appreciated.

J Smillie
J Smillie
39,714 Points

So... I managed to establish that there is a problem with my .jar files in my apps libs directory. But I have now updated them to be accurate in build.gradle and app.iml

I'm still getting errors though.

Apparently my InboxActivity uses or overrides a deprecated API.

I get these red notes when I try and run my app:

Note: /Users/jonathansmillie/howl/app/src/main/java/com/wolfonmoon/howl/InboxFragment.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

then I get the DexException errors as before. Not sure what to do about it...

Did you eventually find an answer to this? Same problem here.