CordovaActivity不能在PhoneGap的3.4解析为一个类型 [英] CordovaActivity cannot be resolved to a type in Phonegap 3.4

查看:172
本文介绍了CordovaActivity不能在PhoneGap的3.4解析为一个类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我工作的的PhoneGap 通过命令行界面。

Hi I am working on PhoneGap through a command line interface.

我能够在Windows 7中创建一个项目,并运行在命令提示符下一个Android模拟器。

I am able to create a project, and run an android emulator from the command prompt in Windows 7.

由于我进口,复制项目到我的Eclipse工作区中,它显示在一个延伸 CordovaActivity 的主类的一些错误。

Since I imported and copied the project into my workspace in eclipse, it is showing some errors in the main class which extends CordovaActivity.

该错误是:

"CordovaActivity cannot be resolved to a type".

我应该怎么办?

推荐答案

对于那些不希望从命令行使用它谁只是增加一个外部库科尔多瓦,Android项目来解决此问题。

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

请按照下列步骤操作:

从这里下载1-科尔多瓦的Andr​​oid拉链 https://github.com/apache/cordova-android

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

2 - 解压缩zip您的PC上的任何地方。进入框架文件夹中。

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

3导入该提取的zip文件夹/框架在Eclipse作为一个现有的项目,这将导致在工作区科尔多瓦项目(库)。

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-现在,右键点击你的应用项目 - >属性 - > Android系统。在库部分中选择添加,然后选择科尔多瓦项目(库)。

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

5最后补充进口org.apache.cordova;使用扩展CordovaActivity。

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

这篇关于CordovaActivity不能在PhoneGap的3.4解析为一个类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆