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 using ‘android update project’ or to inject it through the ANDROID_HOME environment variable.

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

Today I got the error ‘CordovaActivity cannot be resolved’ in Eclipse while loading my existing Phonegap android application.  After few hours I figure out the problem myself.  When you load the Phonegap application in Eclipse it will load 2 projects, the first one is the Android application project and the second one is the Cordava Library project.

If you load both the projects then only you will get this error.  If you load first the library project and then the application project then you wont have this problem.

Step 1 – Import the Library project first

Import Library Project

Once imported check the xxxxxx-cordava.jar generated under bin directory

Step 2 – Import the application project

Import Application Project

You don’t see the problem now

Today I tried creating my first Android application project via Eclipse.  I use the Eclipse Luna version and trying to create an Android application project for target Android 4.4 release.

I launched the Eclipse icon by double click on the icon and start creating the project.  After I provide all the details like application name, project name, package name, activity name etc… after I hit the finish button it keeps on loading.

I tried few changes in eclipse.ini file which is located in the eclipse installed directory by increasing the memory.  But still the problem exists.

Something trigger my mind.  I use Windows 7 and I installed eclipse inside Program Files folder and I know windows 7 using different permission levels to access anything inside program files folder.

Now I right click on the eclipse icon on desktop and I ran this time as ‘Run as administrator’ and tried creating the project.  It works !!!!