microsoft / msopentech-tools-for-intellij

Plugin for easy and fast development to enable developers of Android Apps to connect to Office 365 services and Azure Mobile Services, and developers of Java middleware to connect to Azure compute services
Apache License 2.0
28 stars 34 forks source link

Gradle build failure- dex exception occurs during create new project for the first time #20

Closed babumuralidharan closed 9 years ago

babumuralidharan commented 9 years ago

Environment: Mac/IntelliJ14

Occurence: When user creates new project for the first time.

Workaround for this issue: Do a clean build and rebuild. Compilation would complete successfully.


Error:Gradle: Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /Users/babu/Downloads/android-sdk-macosx/build-tools/21.0.2/dx --dex --output /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/dex/debug /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/classes/debug /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/dependency-cache/debug /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/gson-2.2.2-5dc0900c661a3afeb26973db85db53c4967226c2.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/mobileservices-1.1.5-4b45447ca16e3137c80c4c014e3957838d920370.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/mobileservices-1.1.5-javadoc-fcd5df42ad5d21f1548a356613dab9b8324e0388.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/mobileservices-1.1.5-sources-0de83007c6c7876edf5c5bc807a22f122329ceca.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/notification-hubs-0.3-javadoc-fe850bcc494ad5d2f82478fbf9c1be34606627c8.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/notification-hubs-0.4-bdf437288819c7e6db5f266f274ace15e34286c1.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/notification-hubs-0.4-sources-bb497eb68fcca520cae851e436642ff6e8aa98ef.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/notifications-1.0.1-cb93cb467835c1ccd3a743873216db163ee3f3c1.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/notifications-1.0.1-javadoc-a59621b5da0d0f23bbe831ad4ee70ea6626448b9.jar /Users/babu/IdeaProjects/AppTest5/app/build/intermediates/pre-dexed/debug/notifications-1.0.1-sources-fc1fdbf305953c3454250f6c79c5f58cbd2567b6.jar
  Error Code:
    2
  Output:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lcom/microsoft/windowsazure/messaging/NotificationHub$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)
selvamohandoss commented 9 years ago

This issue is reproducible with latest build. Compilation would succeed if the user do a clean build and rebuild. But if the user run the app then it throws same Exception.So workaround for this issue is delete the notifications-1.0.1-sources.jar file from lib directory. Exception would not occur both compile time and run time. notifications-1.0.1-sources.jar fie does not used anywhere

BeatriceOltean commented 9 years ago

need to move first to gradle dependencies.

leotilli commented 9 years ago

Blocked by issue #14 Similar to issue #19

kasturiswain commented 9 years ago

This issue is reproducible with latest build. gradlebuild

kasturiswain commented 9 years ago

This issue is fixed and working as expected in the latest build.