Re: Support Library by way of Action Bar Sherlock

302 views
Skip to first unread message

Amanda Cameron

unread,
Oct 30, 2012, 11:22:33 PM10/30/12
to adt...@googlegroups.com
I've looked deeper into the Gradle magick and found the files() option for a dependency, I've since changed both my ABS build.gradle and my app's build.gradle to use it. The resulting .apk is still only containing the support library, so that rules out the maven magick being wrong.

On Tuesday, October 30, 2012 8:24:52 PM UTC-4, Amanda Cameron wrote:
I've been playing with the new build system, as it intregueues me alot. Unfortunately I've been hitting some.. odd.. snags, I managed to get ABS's code restructured in the layout it wants ( It didn't want ot work with the sourceset hack in the docs ), and it builds( As far as I can tell. ), and 'uploads' to a folder on my computer for other projects to pull from, that all works fine, on the library maven repo generation side of it.

The problem appears to be that somewhere along the line, it's forgetting all about ABS and my custom library, becasue all that ends up in the .apk is the android support library's classes, it seems!

build.gradle (app) is here: http://amanda.darkdna.net/p/a08ea ( With the library I made changed to examplelib )
build.gradle (abs) is here: http://amanda.darkdna.net/p/1dbef


the build.gradle for my lib is mostly the same, just qwithout the support lib requirement.

I'm very confused as to this, the only thing I can think of is the maven central's com.google.android:support-v4:r7 is wrong somehow, but If I can avoid writing yet another build.gradle for the support library, I am going to, thus the message here.

Any help would be greatly appreciated,
Amanda.

Jonathan Steele

unread,
Oct 30, 2012, 11:46:27 PM10/30/12
to adt...@googlegroups.com
according to http://search.maven.org/remotecontent?filepath=com/google/android/support-v4/r7/support-v4-r7.pom, it depend on com.google.android:android:<android_version> with provided scope. 

Manfred Moser

unread,
Oct 31, 2012, 12:32:57 PM10/31/12
to adt...@googlegroups.com
That just means that it needs the android runtime ..

Are you explicitly declaring a dependency on the support library and
the abs in your app? That should work..

manfred

Amanda Cameron

unread,
Oct 31, 2012, 1:13:42 PM10/31/12
to adt...@googlegroups.com
Shouldn't the Android gradle plugin be providing the Android runtime itself? There's no compile errors in the process of making it, it just doesn't include my classes, or the ABS classes, in the resulting .apk -- the resources for both end up in the apk though.

Amanda Cameron

unread,
Oct 31, 2012, 5:30:00 PM10/31/12
to adt...@googlegroups.com
After further digging, and playing on a hunch, I found the problem -- I was compiling to java 7 instead of 6, causing dex* to go "NOPE!" -- It probably should have clicked that that's what the "unknown header (cafebabe)" type message meant.

Thanks for all your help. :)

Xavier Ducrohet

unread,
Nov 3, 2012, 3:02:37 AM11/3/12
to adt...@googlegroups.com
Hey Amanda, sorry for the delay (was on vacation).
Dex didn't fail on building with Java 7? I need to look into this (I'm using an older mac with no JDK7 so I haven't tested this yet). I actually want to force the proper version of Java so that there's no issue.
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Amanda Cameron

unread,
Nov 3, 2012, 3:13:30 AM11/3/12
to adt...@googlegroups.com

Actually it did fail, but the build still completed with a success, so I didn't think anything of the slew of mussing café babes. :P

Joe Bowbeer

unread,
Nov 3, 2012, 6:37:29 AM11/3/12
to adt...@googlegroups.com
Xavier,

> I actually want to force the proper version of Java so that there's no issue.

I hope you mean force the proper class-file format, which would be done by specifying the proper source/target compatibility.

Forcing a certain JDK would be a big step backwards; JDK7 has been working great for about 6 months, which is precisely how long I've had no JDK6 on my machines.

Currently, because the new build system isn't doing this internally, I've forced the proper compatibility by adding the following to the gradle files:

ext {
    project.sourceCompatibility = "1.6"

Manfred Moser

unread,
Nov 3, 2012, 12:27:05 PM11/3/12
to adt...@googlegroups.com

I agree with Joe.  The building has to work with Jdk 7. Running multiple JDKs is possible but eg.  on OSX mountain lion actually pretty painful...  And the default is 7, with 6 becoming deprecated in spring next year...

Manfred

Xavier Ducrohet

unread,
Nov 3, 2012, 6:59:32 PM11/3/12
to adt...@googlegroups.com
Yes this is what I mean. It's already in the code of the plugin but doesn't seem to work I guess.

Manfred Moser

unread,
Nov 3, 2012, 8:33:19 PM11/3/12
to adt...@googlegroups.com

Time to upgrade for you I guess ;-)

Reply all
Reply to author
Forward
0 new messages