Plugin fails with tools r14

14 views
Skip to first unread message

Matthias

unread,
Oct 19, 2011, 5:39:34 AM10/19/11
to gradle-android-p...@googlegroups.com
Our projects don't build anymore since we upgraded to the ICS tools (r14). The plugin fails with an error message:

A problem occurred evaluating project ':ignition-core'.
Cause: 

Error. You are using an obsolete build.xml
You need to delete it and regenerate it using
android update project

I suppose that's because the Ant tasks we import have changed? No idea really. Time to tackle this migration to ddmlib I suppose? :-D

Ladislav Thon

unread,
Oct 19, 2011, 6:05:19 AM10/19/11
to gradle-android-p...@googlegroups.com
I suppose that's because the Ant tasks we import have changed? No idea really. Time to tackle this migration to ddmlib I suppose? :-D

ddmlib is quite a small library and only handles interacting with devices. The Android build stuff is in sdklib, which is quite a different beast and has a lot of dependencies, which is why I didn't get it to Maven Central yet.

But Ant tasks changes -- yes, that is very much the cause of trouble here.

(Funny thing is -- I fell in love with Dart and didn't even manage to integrate the pull request by Discobot guys... but I promise I will do it this week! So no promises on tackling the Ant tasks changes...)

LT

Fabio Da Soghe

unread,
Oct 19, 2011, 6:26:24 AM10/19/11
to gradle-android-p...@googlegroups.com
They endeed changed quite a few things in the build system: http://tools.android.com/recent/buildchangesinrevision14

I agree with you about the migration to ddmlib...

2011/10/19 Matthias <m.kae...@googlemail.com>

Matthias

unread,
Oct 21, 2011, 4:08:27 AM10/21/11
to gradle-android-p...@googlegroups.com
I was wondering, how about we compile a list of things that we would have to implement ourselves when removing antlibs entirely from gradle-android-plugin? That way we would stay independent of these brittle APIs once and for all.

I think the beef is actually in the Setup task, since it sets up the build environment (including such things as parsing Android library references from property files), but that should not be exactly hard to rewrite in Gradle. Moreover, this would give us the flexibility to actually make gradle-android-plugin feel like being a true Gradle plugin, and not just an Ant wrapper. For instance, the lack of configure closures for practically anything except the test runner support still strikes me as weird (and is mostly because internally we simply make a task forward to some command line tool or Ant task).

Olle Hallin

unread,
Nov 8, 2011, 7:02:50 AM11/8/11
to gradle-android-p...@googlegroups.com
Hi,

I wonder if it's possible to implement a quick-fix while discussing getting rid of the antlibs completely?

The root cause for this error is that com.android.ant.SetupTask has been replaced by com.android.ant.NewSetupTask in R14.

SetupTask.execute() just throws an exception.

For us, this is a real show-stopper. We have a working Linux version of Android SDK R13 under version control, but now when we try to add the same for Window, it forces us to upgrade to R15 => KABOOM!!!.

The team needs to grow, and the new guys use Windows :(

I'll be happy to contribute, just give me some pointer to for a Git how-to.

Regards,
Olle Hallin


Matthias Käppler

unread,
Nov 8, 2011, 7:37:36 AM11/8/11
to gradle-android-p...@googlegroups.com

The problem is that the ICS sources are not available yet, so we simply don't know what changed about the implementation of SetupTask. Not sure how you would go about fixing it.

Since this was a show stopper for us, too, we switched back to Maven for the time being. I guess that's your best bet.

--
sent on the run, from my precious nexus one. (it rhymes!)

Olle Hallin

unread,
Nov 8, 2011, 7:43:39 AM11/8/11
to gradle-android-p...@googlegroups.com
The ICS sources are available now. I just downloaded them. That is how I isolated the problem. SetupTask is now an empty class with an execute() method that just throws BuildException.

I was a Maven fan for years, but since I discovered Gradle, I never look back.

Olle

2011/11/8 Matthias Käppler <m.kae...@googlemail.com>

Ladislav Thon

unread,
Nov 8, 2011, 7:53:25 AM11/8/11
to gradle-android-p...@googlegroups.com
It's not about ICS sources, it's about Android SDK Tools sources. And since AOSP is back, I think that SDK sources are available again -- but I didn't check. And IIRC, sources for Ant tasks were included right inside the downloaded SDK (but don't know if it is still the case).

LT

2011/11/8 Olle Hallin <olle....@hit.se>

Olle Hallin

unread,
Nov 8, 2011, 8:21:52 AM11/8/11
to gradle-android-p...@googlegroups.com
Well, I don't know if it's ICS or SDK tools sources or both. I haven't been in close contact with any Android sources before ;)

I just followed http://source.android.com/source/initializing.html, and one hour later I managed to find sdk/anttasks/src/com/android/ant/SetupTask.java.

SetupTask always throws BuildException at the very same source code line that was reported by 'gradle --stacktrace build'.

Regards,
Olle

2011/11/8 Ladislav Thon <lad...@gmail.com>
Reply all
Reply to author
Forward
0 new messages