简体   繁体   English

Phonegap-使用Eclipse升级到3.0?

[英]Phonegap - Upgrade to 3.0 with Eclipse?

I am trying to upgrade my Android Phonegap app to 3.0 and am following the official guides. 我正在尝试将我的Android Phonegap应用程序升级到3.0,并遵循官方指南。 I am working on Windows. 我在Windows上工作。

I have ran the command to create the base folder. 我已经运行了创建基本文件夹的命令。 I copied all my www content over as well as updated the config.xml and placed all of my icons and splash screen images in the proper folders. 我复制了我所有的www内容,并更新了config.xml,并将所有图标和初始屏幕图像放置在适当的文件夹中。

I then ran the android build command through the CLI and the platform file tree for android was populated. 然后,我通过CLI运行android build命令,并为android填充了平台文件树。 However, all of the files in the android tree are the demo "hello world" files. 但是,android树中的所有文件均为演示“ hello world”文件。 I thought the build command was suppose to build off of the root www folder? 我以为build命令应该是从根www文件夹构建的吗? From what I have read the platform tree files are overwritten when you run the build command again once you update your root files? 据我了解,一旦更新根文件,再次运行build命令时,平台树文件将被覆盖? Am I suppose to erase all of the android helloworld files? 我是否想擦除所有android helloworld文件?

I don't have any platform dependent .js files, it would just be the plugins. 我没有任何依赖于平台的.js文件,仅是插件。 Also, the test helloworld app links the phonegap.js file to the root js/phonegap.js but there is no such file, the file is found in the platform www folder. 同样,测试helloworld应用程序将phonegap.js文件链接到根js / phonegap.js,但是没有这样的文件,该文件位于platform www文件夹中。 So the link is incorrect. 因此链接不正确。

Also, I am not able to get this type of file tree to work with Eclipse. 另外,我无法使用这种类型的文件树来使用Eclipse。 Is it even possible to use Eclipse with the new 3.0 file structure? 甚至可以将Eclipse与新的3.0文件结构一起使用吗? Trying to build anything using Ant is a nightmare. 试图使用Ant构建任何东西都是一场噩梦。

Could someone provide some guidance for this type of upgrade? 有人可以为这种类型的升级提供一些指导吗? The documentation is very short. 该文档非常简短。

Thanks. 谢谢。

EDIT: 编辑:

Maybe some more specific questions. 也许一些更具体的问题。

-From what I understand when I edit my app I edit the root www folder, not the android sub www folder correct? -据我了解,当我编辑应用程序时,我编辑了根www文件夹,而不是正确的android sub www文件夹?

-If this is correct then do I have to run "Phonegap build" every time I edit the www root folder so then it will hopefully update my android www folder? -如果这是正确的,那么我每次编辑www根文件夹时是否都必须运行“ Phonegap build”,以便它有望更新我的android www文件夹?

I erased all of the helloworld data from the android www folder and replaced the data with my root www data. 我从android www文件夹中删除了所有helloworld数据,并将其替换为我的根www数据。 I then modified the root www data and ran the build command for android. 然后,我修改了根www数据并为android运行了build命令。

After running the build command for the android platform from the root www folder there was no change to the android www folder. 从根www文件夹运行android平台的build命令后,android www文件夹没有任何更改。

-Why have a root folder with the www data if I have to manually update the www folder for the android build? -如果我必须为Android构建手动更新www文件夹,为什么要带有包含www数据的根文件夹? So every time I make a change to the root folder I now have to change the android www folder as well. 因此,每次我更改根文件夹时,现在也都必须更改android www文件夹。

-Why even have a root www folder if I have to manually change everything in the android www folder? -如果我必须手动更改android www文件夹中的所有内容,为什么还要有一个根www文件夹?

-Everything from the www root folder has to be in the android www folder or I can't run Eclipse to test the app. -www根文件夹中的所有内容都必须位于android www文件夹中,否则我将无法运行Eclipse来测试该应用。

-It seems like I am maintaining two copies of the exact same work for no reason. -似乎我无缘无故地维护着两份完全相同的作品。

I am obviously doing something wrong with how I am maintaining my code base? 我在维护代码库方面显然做错了什么?

I Am kind of struggling the same way, see Upgrade to phonegap 3.3.0 我有点挣扎,请参见升级到phonegap 3.3.0

I did not find all the asnwers yet, but some of them are in my question and answers. 我还没有找到所有的答案,但是其中一些在我的问答中。

Your first question: theoretically you should only edit the root www folder (which I called the blue-print www folder), and with phonegap or cordova build, it should make all the needed things in the android platform.... but it seems not all is working well yet... so that's why you still have to do some things also in the android folder.... (in deed, double work and not yet so handy). 您的第一个问题:从理论上讲,您只应编辑根www文件夹(我将其称为蓝图www文件夹),并使用phonegap或cordova构建,它应可在android平台上制作所有需要的东西。并不是所有人都工作得很好...所以这就是为什么您仍然必须在android文件夹中做一些事情....(实际上,是双重工作,还不太方便)。

Please note that the config xml in the root (or blueprint) folder is not the same as the one that should be in the platform\\android folder... it has a different schema and defines all the things needed for both config and android manifest files etcetera. 请注意,根(或蓝图)文件夹中的config xml与应该位于platform \\ android文件夹中的xml不同...它具有不同的架构,并定义了config和android manifest所需的所有内容文件等。

best thing to do is to create a new empty phonegap project, and look for those files as an example (keep this newly created files as a copy... just to check once in a while how it should work). 最好的办法是创建一个新的空phonegap项目,并以这些文件为例(保留此新创建的文件作为副本...只是不时检查一下其工作方式)。 Because documentation does not describe this blueprint config.xml file... only the one that's created with the build command! 因为文档中没有描述该蓝图config.xml文件,所以……仅是使用build命令创建的文件!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM