New PhoneGap 3.0 The import org.apache.cordova cannot be resolved

android, cordova, eclipse, java, javascript

Solution

Update: If you upgrade to Phonegap 3.3 you shouldn't need to do this anymore. Details on updating Phonegap: http://phonegap.com/blog/2013/12/13/phonegap-release/

Note: Make sure in eclipse you import Existing Android Code into Workspace NOT 'Existing Projects into Workspace

I had the exact same problem and found a solution that works:

- Download the source ZIP for Cordova: http://cordova.apache.org/#download

- Extract the 'cordova-android' ZIP anywhere. Inside will be a 'framework' folder.

- In eclipse open the newly unzipped 'cordova-android/framework' folder as an existing project.

- In eclipse right click on this new 'Cordova' project -> Properties -> Android . Make sure 'Is Library' is checked.

- Right click on your app's project -> Properties -> Android. In the Library section choose 'Add'. Select your Cordova project.

All done, import should now resolve!

Problem

I'm installing the new phone gap 3.0 with the all-mighty command line. ``` cordova create hello com.example.hello HelloWorld cordova platform add android ``` When I open the android project in eclipse I get this error on `HelloWorld.java`: ``` The import org.apache.cordova cannot be resolved ``` I guess I have a missing library but how to I solve this if the only way to install 3.0 is thought the command line.

Original source