That worked!
I changed the
settings.gradle<https://github.com/tleyden/stubworld-app-android-hybrid/blob/b84448a69c7f4c277b1cd0698b66a6d406670743/settings.gradle>
file
and the
build.gradle<https://github.com/tleyden/stubworld-corelib-android/blob/46fc6d6d45a2e3ead97b79f3d46eb90354a9175d/build.gradle>files
at /libraries/stubworld-corelib-android/ and
/libraries/stubworld-corelib-sqlite4java/, and now:
* The outermost project: stubworld-app-android-hybrid builds
* stubworld-corelib-android still works as a standalone project
Thanks a lot, I really appreciate the help.
On Saturday, February 1, 2014 1:17:17 AM UTC-8, Alberto Alonso Ruibal wrote:
>
> 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.