新的PhoneGap 3.0导入org.apache.cordova无法解析 [英] New PhoneGap 3.0 The import org.apache.cordova cannot be resolved
问题描述
cordova create hello com.example.hello HelloWorld
cordova platform添加android
当我在eclipse中打开android项目时,我在 HelloWorld.java
上收到此错误:
导入org.apache.cordova无法解析
我想我有一个缺少的图书馆,但是如果我们解决这个问题,如果安装3.0的唯一方法就是命令行。
更新:如果您升级到Phonegap 3.3,您不应该再需要这样做了。有关更新Phonegap的详细信息: http://phonegap.com/blog / 2013/12/13 / phonegap-release /
注意确保在eclipse中导入现有的Android代码进入工作区不将现有项目导入工作空间
我有完全相同的问题,找到了一个解决方案:
- 下载Cordova的源ZIP:
http://cordova.apache.org/#download - 提取cordova-android
ZIP 。内部将是一个框架文件夹。 - 在eclipse中打开新解压缩的cordova-android / framework
文件夹作为现有项目。 - 在eclipse中右键点击这个新的Cordova
项目 - >属性 - > Android 。确保选中是库。 - 右键单击应用程序的项目 - >属性 - > Android 。在
中,库部分选择添加。选择您的Cordova项目。
全部完成,导入现在应该可以解决!
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.
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!
这篇关于新的PhoneGap 3.0导入org.apache.cordova无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!