上一篇 我们实现在用命令行运行想 PhoneGap 的 HelloWorld
phonegap run android
这次我们改用Eclipse运行.
首先先看一下,上次用phonegap run android, 在my-app下生成的文件目录
文件夹详解:
www : 文件夹 开发的 HTML5 ; CSS ; JS 文件都拷贝到这下面
plugins : 文件夹 存放的是phonegap插件 以后 文件,摄像头等插件都下载到这里,在下篇文章中介绍用法
merges : 我也没用过 以后知道了再补上
platforms : 文件夹 存放的是编译好后的android文件 ,(如果这个文件夹为空,需要你在命令行编译一次才能生成. 如上面 phonegap run android)
.cordova : 存放的是配置文件
将platforms文件夹导入 eclipse 就可以使用
phonegap run android
这次我们改用Eclipse运行.
首先先看一下,上次用phonegap run android, 在my-app下生成的文件目录
文件夹详解:
www : 文件夹 开发的 HTML5 ; CSS ; JS 文件都拷贝到这下面
plugins : 文件夹 存放的是phonegap插件 以后 文件,摄像头等插件都下载到这里,在下篇文章中介绍用法
merges : 我也没用过 以后知道了再补上
platforms : 文件夹 存放的是编译好后的android文件 ,(如果这个文件夹为空,需要你在命令行编译一次才能生成. 如上面 phonegap run android)
.cordova : 存放的是配置文件
将platforms文件夹导入 eclipse 就可以使用
phonegap 将以第三方库的形式导入
如果报找不到 cordovalib.jar
请按如下两种办法之一解决
解决方法一:
解决方法二:
1. 把 HelloWorld 和 HelloWorld-Cordova 都删除
2.
Project ->Build Automatically.
makesure u select Build Automatically then try import the project.
I noticed whenever i didnt select build automatically i will have missing .jar in cordavalib folder.
3. 再Import platform文件夹
都没有错误了之后, 直接build project 就可以在手机或者模拟器上看到 箱子机器人啦!
如果报找不到 cordovalib.jar
请按如下两种办法之一解决
解决方法一:
- Import both the project Hello and cordova lib project
- Remove the reference project(Cordova lib) from Hello Project. RightClick project-> Android-> Click reference project and Click Remove
- Clean the lib project and rebuild it , repeat this steps couple of time, till you don't see the yellow sign appears to lib project(which is a warning sign).
- Then again go to your Hello project and add the reference of the lib project you are done now. Error should go off by now.
解决方法二:
1. 把 HelloWorld 和 HelloWorld-Cordova 都删除
2.
Project ->Build Automatically.
makesure u select Build Automatically then try import the project.
I noticed whenever i didnt select build automatically i will have missing .jar in cordavalib folder.
3. 再Import platform文件夹
都没有错误了之后, 直接build project 就可以在手机或者模拟器上看到 箱子机器人啦!