Today I face a strange problem while doing ‘ant clean’ after building the phonegap project.  The full error is as below.

\CordovaLib\build.xml:55: sdk.dir is missing. Make sure to generate local.properties using ‘android update project’ or to inject it through the ANDROID_HOME environment variable.

The problem is because the local.properties file inside the cordova library project is incomplete.  By default the local.properties file will contain the path for sdk.dir.  In my case the file was empty.  I just copied the local.properties from some other project and replaced here and the problem solved.