Hi,

I'm running with this problem having the latest gradle plugin (i'm trying 
out the new multidex config).

Just changing a line in one source file takes up to 1m 50s to build and as 
the original post stated, the *--incremental* flag is not included and a 
"Force full dx run" is triggered.

*My config:*
Gradle plugin version: 0.14.0
AS version: 0.9 (Canary Channel)

*Output of ./gradlew --version*
------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------

Build time:   2014-09-08 10:40:39 UTC
Build number: none
Revision:     e6cf70745ac11fa943e19294d19a2c527a669a53

Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.7.0_25 (Oracle Corporation 23.25-b01)
OS:           Mac OS X 10.9.5 x86_64


The command output is something like:


*$ANDROID_SDK/build-tools/21.0.2/dx --dex --multi-dex --main-dex-list 
$PROJECT_HOME/build/intermediates/multi-dex/debug/maindexlist.txt 
--output $PROJECT_HOME/build/intermediates/dex/debug 
--input-list=$PROJECT_HOME/build/intermediates/tmp/dex/debug/libraryList.txt*


I have the incremental option enabled in my build.gradle:
android {
.....
    dexOptions {
        incremental true
    }
}

Thanks!

Regards,
marcos.

El viernes, 19 de septiembre de 2014 15:17:20 UTC-3, Kirill Rakhman 
escribió:
>
> Thanks to your comment I just realized that predexed libraries are causing 
> this behaviour. If you disable predexing incremental dexing seems to work 
> and is also quiet a bit faster. My guess is: Since incremental dexing 
> doesn't dex everything predexing isn't a speedup anymore. Libraries are 
> dexed once because their class files don't change.
>
> Am Freitag, 19. September 2014 18:55:11 UTC+2 schrieb Thasso Griebel:
>>
>> Hey,
>>
>> just to confirm, I also still see the issue with the latest 0.13.0 gradle 
>> plugin. The duplicated class is found first in :
>>
>> <submodule_folder>/build/intermediates/dex/debug/classes.dex
>>
>> as well as in 
>>
>>
>> <submodule_folder>/build/intermediates/pre-dexed/debug/acra-4.4.0-4f3087dc293438b0cfab28d844cf164e6fb101ba.jar
>>
>> acra is a third party dependency used by the module.
>>
>> The following stacktrace is printed:
>>
>>    UNEXPECTED TOP-LEVEL EXCEPTION:
>>    com.android.dex.DexException: Multiple dex files define 
>> Lorg/acra/ACRA$1;
>>           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)
>>
>> Any advice if the combination of incremental dexing + predexing is 
>> suppose to work or how we could get it to work would be much appreciated.
>>
>> Best,
>> -Thasso
>>
>>
>> On Thursday, September 18, 2014 11:18:45 PM UTC+2, Michael Wallstedt 
>> wrote:
>>>
>>> I can confirm that the "multiple dex files define x" error occurs in 
>>> Android Studio 0.8.2 with a multi module project. Is there a bug to track 
>>> this and/or an ETA for a fix?
>>>
>>> On Friday, June 20, 2014 7:28:18 AM UTC-7, Mike Kulasinski wrote:
>>>>
>>>> Hi 
>>>>>
>>>>> I have also experienced the Multiple dex problem, I have turned of 
>>>>> incremental dexing and this fixed the issue, I am running Gradle 1.12, 
>>>>> Android Studio 0.6.1, Android Gradle Plugin 1.11.1. I have experienced 
>>>>> this 
>>>>> problem from early version 0.10.
>>>>>
>>>>> Any idea how to fix this problem?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Mike
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to