A quick snippet if you want to try it out.
>
>
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
compile('com.segment.analytics.android:analytics:3.0.1-SNAPSHOT@aar') {
// exclude group: 'com.segment.analytics.android', module:
'analytics-integration-google-analytics'
// exclude group: 'com.segment.analytics.android', module:
'analytics-integration-mixpanel'
transitive = true
}
On Tuesday, March 3, 2015 at 11:23:27 AM UTC-7, Prateek Srivastava wrote:
>
> In particular, I'm running into this error when I depend on Library A,
> that depends on Library B, which depends on Library C (all aars).
> When Library C is packaged as a jar, I don't run into this issue.
>
> This is what the dependency tree looks like:
> +--- com.segment.analytics.android:analytics:3.0.1-SNAPSHOT@aar
> | +--- ...
> | +---
> com.segment.analytics.android:analytics-integration-mixpanel:3.0.1-SNAPSHOT@aar
> | | \--- com.mixpanel.android:mixpanel-android:4.5.3@aar
> | +---
> com.segment.analytics.android:analytics-integration-google-analytics:3.0.1-SNAPSHOT@aar
> | | \--- com.google.android.gms:play-services-base:6.5.87@aar
>
> I originally thought that this issue occurred when Library B didn't
> declare it's packaging as an AAR in it's pom, but you'll see in the
> examples below that isn't the case.
>
> In one such case, here is the Pom for Library A (
> https://oss.sonatype.org/content/repositories/snapshots/com/segment/analytics/android/analytics/3.0.1-SNAPSHOT/analytics-3.0.1-20150303.075625-17.pom),
>
> and for Library B (
> https://oss.sonatype.org/content/repositories/snapshots/com/segment/analytics/android/analytics-integration-mixpanel/3.0.1-SNAPSHOT/analytics-integration-mixpanel-3.0.1-20150303.075744-18.pom)
>
> and Library C (
> https://repo1.maven.org/maven2/com/mixpanel/android/mixpanel-android/4.5.3/mixpanel-android-4.5.3.pom
> ).
>
> In another case, here is the pom for Library A (
> https://oss.sonatype.org/content/repositories/snapshots/com/segment/analytics/android/analytics/3.0.1-SNAPSHOT/analytics-3.0.1-20150303.075625-17.pom),
>
> Library B (
> https://oss.sonatype.org/content/repositories/snapshots/com/segment/analytics/android/analytics-integration-google-analytics/3.0.1-SNAPSHOT/analytics-integration-google-analytics-3.0.1-20150303.075721-16.pom),
>
> and Library C is Google Play Services.
>
> On Thursday, September 4, 2014 at 8:59:41 AM UTC-6, Jonathan Almeida wrote:
>>
>> Hi Xavier,
>>
>> Do you have any update on this? We're facing this exact problem right now
>> and it's a show stopper for us.
>>
>> To give a bit more detail on our situation:
>>
>> 1. We have a java library on maven that's built with a 'core' module
>> dependency. This shows up fine in the pom file when publishing to
>> maven/mavenLocal.
>> 2. When we add the java library as a dependency to our android
>> library, the pom file generated doesn't contain the dependeny 'java
>> library'. <- Problem 1
>> 1. This was fixed with a little hack from this SO answer:
>> http://stackoverflow.com/a/24764713/936067
>> 3. Now, when we add our android library to an android app as a
>> dependency, it spits out the above error.
>>
>>
>> Things that I've tried that should be noted:
>>
>> - Removing the pom file hack, lets me build the android app with my
>> library as a dependency, but since the library's dependency isn't pulled
>> down, it crashes.
>> - Removing Google dependencies, appcompat, support and play-services,
>> and only adding in the 'core'. Let's me build and run, but now I have
>> very
>> limited functionality in my library.
>> - Removing the pom file hack, and adding the library dependencies in
>> the android app itself, lets the app use my library's functionality as
>> expected, however, this is tedious for users to do and breaks the java
>> dependency management idiom.
>>
>> *Any help *is much appreciated to get past this bug. Thank you!
>>
>> You can find my related question on SO as well:
>> http://stackoverflow.com/questions/25585537/importing-my-android-library-in-an-app-isnt-recognized-as-a-library
>>
>> On Thursday, December 5, 2013 8:13:30 PM UTC-5, Xavier Ducrohet wrote:
>>>
>>> This is strange, and should not happen AFAIK.
>>>
>>> I'll do some tests.
>>>
>>>
>>> On Wed, Dec 4, 2013 at 8:26 AM, Mark Murphy <[email protected]>
>>> wrote:
>>>
>>>> I am running into the same problem as is outlined in this question,
>>>> though not with Sonatype Nexus:
>>>>
>>>>
>>>> http://stackoverflow.com/questions/20061652/android-gradle-library-dependency-with-library-dependency-using-nexus
>>>>
>>>> Scenario: I have App A, depending upon Library B, which in turn depends
>>>> upon Library C.
>>>>
>>>> Library C is in a Maven repo. Library B is in the same repo, with a POM
>>>> that contains the dependency upon Library C.
>>>>
>>>> App A has Library B in its dependencies. However, running gradle clean
>>>> assembleDebug results in:
>>>>
>>>> "Module version [Library B] depends on libraries but is not a library
>>>> itself"
>>>>
>>>> The error does not make a lot of sense to me, particularly since if I
>>>> install both Library B and Library C to mavenLocal(), and switch my
>>>> build.gradle to use mavenLocal(), it works. IOW, this is only a problem
>>>> with a remote repository.
>>>>
>>>> Is there a known limitation in having an AAR depend upon another AAR in
>>>> a remote Maven artifact repository?
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> Mark Murphy (a Commons Guy)
>>>> http://commonsware.com | http://github.com/commonsguy
>>>> http://commonsware.com/blog | http://twitter.com/commonsguy
>>>>
>>>> _The Busy Coder's Guide to Android Development_: 2,500+ Pages, Updated
>>>> Frequently!
>>>>
>>>> --
>>>> 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!
>>>
>>
--
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.