Ducrohet is right, you should have only one stubworld-corelib-java in the 
project

1) Move 
/libraries/stubworld-corelib-android/libraries/stubworld-corelib-java to 
/libraries
2) Delete the other 
/libraries/stubworld-corelib-sqlite4java/libraries/stubworld-corelib-java
3) Change your /settings.gradle to include the library only one time:

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

4) Modify the build.gradle files at /libraries/stubworld-corelib-android/ 
and /libraries/stubworld-corelib-sqlite4java/ to include the common library 
from the root of the project
* adding ":" at the beginning*
compile project('libraries:stubworld-corelib-java') -> compile project('*:*
libraries:stubworld-corelib-java')

You were missing this colon and probably this was confusing you.

On Saturday, February 1, 2014 12:16:12 AM UTC+1, Traun Leyden 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.

Reply via email to