升级到PhoneGap的3.3.0 [英] Upgrade to phonegap 3.3.0

查看:180
本文介绍了升级到PhoneGap的3.3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从PhoneGap的2.9.0升级我的PhoneGap项目(S)到最新版本,PhoneGap的3.3.0。 因为它有很多大的改进。

I Am upgrading my phonegap project(s) from phonegap 2.9.0 to the latest one, phonegap 3.3.0. Because it has a lot of big improvements.

这是关于一个Android项目,但很快就被内部监督办公室以及

It's about an android project, but soon to be ios as well

不过,我很吃力的感觉了几天,仍然没有工作code。

However, I Am struggling with it a few days, and still no working code.

我已经做到了这一点:

安装的PhoneGap和creted喜欢手工一个新项目: http://phonegap.com/install/

Installed phonegap and creted a new project like the the manual: http://phonegap.com/install/

在此我慢慢地插入我的老code到www文件夹,并在新的3.0的方式安装的插件。

After this I slowly inserted my old code into the www folder and installed the plugins on the new 3.0 way.

不过,无论我做什么......我得到这个讨厌的:

But whatever I do... I get this annoying:

错误初始化科尔多瓦:找不到类

Error initializing Cordova: Class not found

由于我以前在Eclipse中运行它,并使用调试控制台(并没有找到如何TOT获得debuging从CLI的工作......一些调查,在那里做),我试图得到它的工作日食。

Because I used to run it in eclipse and use this debugging console (And did not find out how tot get the debuging from the cli to work... some more investigation to do there), I tried to get it working in eclipse.

但在那里,它不具备的科尔多瓦罐子,我找不到它的任何地方。 我曾经在科尔多瓦 - 2.9.0.jar添加到构建路径,但目前还没有科尔多瓦-3.3.0.jar。 我看到了一个答案abouyt创建它yourselve:但后来说是不正确的方法(ANS因为没有PhoneGap的文件,这是提到...我无法想象这就是方式)

But there, it does not have the cordova jar, and I can't find it anywhere. I used to add the cordova-2.9.0.jar to the build path, but there is no cordova-3.3.0.jar. I saw an answer abouyt creating it yourselve: but this was later remarked as not the proper way (ans since in no phonegap documentation this is mentioned... i cannot imagine that's the way)

在Eclipse中,这是导致该错误:进口org.apache.cordova *;

In eclipse, this is causing the error: import org.apache.cordova.*;

所以,就像我说的...没有科尔多瓦罐子......藿你解决这个?

So like I said... no cordova jar... hwo do you resolve this?

这样几个问题一下子...

  1. 要获得更好的调试:我如何得到这个工作在eclipse
  2. 为什么我得到这个错误...找不到类(可能与相关 丢失的罐子)
  1. To get better debugging: how do i get this working in eclipse
  2. Why do I get this error... class not found (probably related with the missing jar)

没有一个相关的问题给了一个解决方案,我...

None of the related questions gave a solution for me...

修改 我正要加入,步骤详细,像我floowed此步骤: 的http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface

Edit I was just going add, the steps in more detail, like I floowed this step: http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface

但比我注意到...这个命令:

but than I noticed... this command:

须藤NPM安装-g科尔多瓦

sudo npm install -g cordova

我想我已经做了,但我做了:

which I thought I had done, but I had done:

须藤NPM安装-g的PhoneGap

sudo npm install -g phonegap

但是,这并没有什么差别。

But this does not make any difference.

与运行它:`

PhoneGap的运行Android -V --device

phonegap run android -V --device

`给出:

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[phonegap] Generating config.xml from defaults for platform "android"
[phonegap] Compiling app on platform "android" via command "/Path to my app/platforms/android/cordova/build" 
[phonegap] Platform "android" compiled successfully.
[phonegap] successfully compiled Android app
[phonegap] installing app onto device
[phonegap] Generating config.xml from defaults for platform "android"
[phonegap] Running app on platform "android" via command "/Path to my app/platforms/android/cordova/run" --device
[phonegap] Platform "android" ran successfully

但仍提供了错误和以前一样。 而在日食仍然需要添加科尔多瓦罐子,这是无处可寻。

but still gives the error as before. And in eclipse still need to add the cordova jar, which is nowhere to be found..

编辑2

我创建了一个新的项目,只是为了看看发生了什么将这个日食的时候..它似乎工作。所以我删除了从ecplise项目......并把它添加(floowing的PhoneGap的文档的thsi:新的Andr​​oid项目;添加从现有code)。而现在,它创建了一个名为新的jar - 科尔多瓦 - lib.jar在文件夹平台/ CordovaLib /箱

I created a new project, just to see what happened when adding this to eclipse.. and it seemed to work. So I removed the project from ecplise... and added it (floowing the phonegap docs for thsi: new android project; Add from existing code). And now it creates a new jar named - cordova-lib.jar in the folder platforms/CordovaLib/bin

这似乎在命令行运行命令工作月食......还是一样的错误。但现在我可以尝试从Eclipse中运行它,并找出更多...(我会尽快为我找出什么是错误张贴)

and this seems to work for eclipse... still the same error in the cli run command. But now I can try to run it from eclipse and find out more... (I will post it as soon as I find out what is the error)

修改3

运行它在Eclipse中显示错误(奇怪,这不是在PhoneGap的的-V模式所示):

running it in eclipse shows the error (weird that this is not shown in the -V mode of phonegap):

01-05 09:04:16.557: D/CordovaLog(698): file:///android_asset/www/phonegap.js: Line 1544 : Could not find cordova.js script tag. Plugin loading may fail.
01-05 09:04:16.567: I/Web Console(698): Could not find cordova.js script tag. Plugin loading may fail. at file:///android_asset/www/phonegap.js:1544

但是,为什么不是这个js文件有....

But why isn't this js file there....

修改16-JAN-2014年

这正在成为一种流行的问题,也关注一下。所以我不是唯一一个与PhoneGap的3.x的挣扎这里是另外一个尚未解决的问题:<一href="http://stackoverflow.com/questions/20953653">http://stackoverflow.com/questions/20953653/config-xml-phonegap-3-3-0-ignores-name-and-description

This is becoming a popular question too look at. So I am not the only one struggling with phonegap 3.x And here is another yet unsolved question: http://stackoverflow.com/questions/20953653/config-xml-phonegap-3-3-0-ignores-name-and-description

修改21-JAN-2014年 重要提示(看到了很多关于这个问题):如PhoneGap的文档中描述的蓝图WWW config.xml文件folderis不一样的。它有另一个模式,是蓝图,无论每个平台的config.xml中,作为很多其他的事情和文件(androoid清单XML文件,图标等)。不幸的是我还没有发现在PhoneGap的文档此config.xml文件(该平台相关的目标config.xml文件中只是一个好的descrition)的正确描述(除了架构)呢。这是非常混乱,他们选择了同一个名字一个非常不同的文件...

EDIT 21-jan-2014 Important note (see a lot of questions about this): the config.xml in the blueprint www folderis not the same as described in the phonegap docs. It has another schema, and is the blueprint for both the config.xml per platform, as a lot of other things and files (androoid manifest xml files, icons etc.). Unfortunately I have not found a proper description (besides the schema) of this config.xml file (only a good descrition of the platform dependent targets config.xml file) in the phonegap docs yet. And it is very confusing they choose the same name for a very different file...

修改的12月 - 2014年 这可能是有益的......因为我仍然无法找到这个所谓的蓝图config.xml中的PhoneGap的页面上的正确描述:的 https://github.com/phonegap/phonegap-start/blob/master/www/config.xml

EDIT 12-feb-2014 This might be helpfull... since I still cannot find a proper description of this so called blueprint config.xml on the phonegap pages: https://github.com/phonegap/phonegap-start/blob/master/www/config.xml

修改5月5日2014年

由于PhoneGap的所有问题,背后的PhoneGap原则的好处已经为我。 (我仍然相信潜在的PhoneGap可以解...但现在它以premature)。所以,我很抱歉,我得离开PhoneGap的路径。我让这个答案打开那些仍在寻找答案......但不要指望任何答案或接受正确的答案我。

Due to all problems in phonegap, the benefits of the principle behind phonegap has gone for me. (I still believe in potential phonegap can be the solution... but for now it's to premature). So I Am sorry i have to leave the phonegap path. I let this answer open for the ones still searching for answers... but do not expect any answers or the 'acceptance of the right answer' from me.

推荐答案

由于它一直抱怨没有被发现的类,我怀疑这是对插件类。所以我删除了所有这些,reisntalled他们,现在它的工作。

Because it kept complaining about the classes not being found, I suspected this was about the plugin classes. So I removed them all and reisntalled them, now it's working.

删除所有插件和重新安装

Remove all plugins and reinstall them

phonegap plugin list

[phonegap] org.apache.cordova.camera
[phonegap] org.apache.cordova.console 
[phonegap] org.apache.cordova.device
[phonegap] org.apache.cordova.device-motion
[phonegap] org.apache.cordova.device-orientation
[phonegap] org.apache.cordova.dialogs 
[phonegap] org.apache.cordova.file 
[phonegap] org.apache.cordova.file-transfer 
[phonegap] org.apache.cordova.geolocation 
[phonegap] org.apache.cordova.inappbrowser    
[phonegap] org.apache.cordova.media 
[phonegap] org.apache.cordova.media-capture
[phonegap] org.apache.cordova.network-information
[phonegap] org.apache.cordova.splashscreen

phonegap plugin help

对于所有安装,我这样做(我couldnot找到一个*来卸载它们一次全部)​​

for all installs I did this (I couldnot find a * to deinstall them all at once)

phonegap plugin remove org.apache.cordova.device

之后,我重新安装了它们,所以对于所有的插件:

and after that I reinstalled them, so for all plugins:

phonegap plugin add org.apache.cordova.device

该做的伎俩我....

This did the trick for me....

修改

顺便说一句,几天后我发现,如果你在Eclipse中运行的东西。你应该添加2个项目。一个完整的项目(如一个一般项目,而不是机器人)的。在那里,你可以编辑code在蓝印WWW文件夹。和编辑后,您运行CLI(命令行界面)命令:'科尔多瓦建设,比你可以从第二个项目运行(您添加的平台/ Android的文件夹作为Android项目,利用现有的code添加)。

By the way, a few days later I found out that in case you run things in eclipse. You should add 2 projects. One of the complete project (as a general project, not android). There you can edit the code in the blue print WWW folder. And after editing, you run the cli (command line interface) command: 'cordova build' and than you can run it from the second project (you add the platforms/android folder as a android project, using add from existing code).

这篇关于升级到PhoneGap的3.3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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