failed to create task or type checkenv Cause The name is undefined-Collection of common programming errors

is required for the Android build, it’s in a library in the Android SDK directory. I had the same problem and discovered the cause was a bad directory in the local.properties file required by build.xml and buildAndroid.xml. Here’s a sample of my local.properties file:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/Users/myusername/android-sdk-macosx

This gets generated automatically when I’m in Eclipse, but when Eclipse is closed and I’m working with ant at the command line, it was not updated and had some other user’s information that had been committed to SVN and I checked out with an svn update.

I updated it to point to my own Android SDK directory and everything started working.

Hope that helps!