Looking at your settings.gradle, I think there's a problem:

You basically do:

include ':app'
include ':libraries:stubworld-corelib-sqlite4java'
include
':libraries:stubworld-corelib-sqlite4java:libraries:stubworld-corelib-java'
include ':libraries:stubworld-corelib-android'
include
':libraries:stubworld-corelib-android:libraries:stubworld-corelib-java'

Do you really have 2 copies of the stubworld-corelib-java libraries in
those two folders? If that's the case, as far as Gradle is concerned there
are 2 different projects and so it cannot de-dup them. You should have only
one version and have the 2 other libraries depend on the single copy.


On Fri, Jan 31, 2014 at 3:21 PM, Xavier Ducrohet <[email protected]> wrote:

> This should work. I'll investigate.
>
>
> On Fri, Jan 31, 2014 at 3:16 PM, Traun Leyden <[email protected]>wrote:
>
>>
>> Is it possible to have two source-based library dependencies to the same
>> library within a single project?
>>
>> For example, I have the following multi-project structure:
>>
>> - stubworld-app-android-hybrid
>>   - stubworld-corelib-android
>>     - stubworld-corelib-java  <-- included once
>>   - stubworld-corelib-sqlite4java
>>     - stubworld-corelib-java  <-- included again
>>
>> (the full project hierarchy / 
>> code<https://github.com/tleyden/stubworld-app-android-hybrid>is available on 
>> github)
>>
>> when I try to build it with gradle I get the following error:
>>
>>     UNEXPECTED TOP-LEVEL EXCEPTION:
>>   com.android.dex.DexException: Multiple dex files define
>> Lcom/stubworld/core/StorageEngine;
>>
>> where the com.stubworld.core.StorageEngine class is defined in the
>> stubworld-corelib-java library that is double-included.
>>
>> I think I already know the answer -- switch to maven artifacts and the
>> problem will just go away.  However, declaring library dependencies as
>> source dependencies is actually very convenient for debugging and fixing
>> library code in-place.
>>
>> Is there some way to make this work without resorting to maven artifacts?
>>
>> --
>> 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/groups/opt_out.
>>
>
>
>
> --
> Xavier Ducrohet
> Android SDK Tech Lead
> Google Inc.
> http://developer.android.com | http://tools.android.com
>
> Please do not send me questions directly. Thanks!
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
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/groups/opt_out.

Reply via email to