See inline responses below.
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.
>
Yes, it's currently set up like that.
> You should have only one version and have the 2 other libraries depend on
> the single copy.
>
So the settings.gradle would look like this?
include ':app'
include ':libraries:stubworld-corelib-sqlite4java'
include ':libraries:stubworld-corelib-android'
include ':libraries:stubworld-corelib-java'
If I did that approach, would it still be possible to have
stubworld-corelib-android
function as a self contained project that depends on stubworld-corelib-java?
Eg,
- stubworld-corelib-android
- stubworld-corelib-java
It feels like to make that work I'd need a way to make the
stubworld-corelib-android
project sometimes have a hard dependency on stubworld-corelib-java, and
sometimes not (when it's embedded in a parent project that already declares
that dependency). Is there any way to do that? Or would it be more
practical to forget about trying to make stubworld-corelib-android function
as a self contained project?
>
>
> On Fri, Jan 31, 2014 at 3:21 PM, Xavier Ducrohet
> <[email protected]<javascript:>
> > wrote:
>
>> This should work. I'll investigate.
>>
>>
>> On Fri, Jan 31, 2014 at 3:16 PM, Traun Leyden
>> <[email protected]<javascript:>
>> > 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] <javascript:>.
>>> 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.