CordovaActivity cannot be resolved to a type in Phonegap 3.4

android, cordova

Solution

For those who don't want to use it from command line just add an external library cordova-android project to resolve this issue.

Follow these steps:

1- Download Cordova android zip from here https://github.com/apache/cordova-android.

2- Extract zip anywhere on your PC. Go inside framework folder.

3- Import this extracted zip folder/framework in your eclipse as an existing project which will result in Cordova project(library) in your workspace.

4- Now right click on your app project -> Properties -> Android. In the Library section choose 'Add' and select Cordova project(library).

5- Finally add import org.apache.cordova; to use extend CordovaActivity.

Problem

Hi I am working on `PhoneGap` through a command line interface. I am able to create a project, and run an android emulator from the command prompt in Windows 7. Since I imported and copied the project into my workspace in eclipse, it is showing some errors in the main class which extends `CordovaActivity`. The error is: ``` "CordovaActivity cannot be resolved to a type". ``` What should I do?

Original source