如何从phonegap 2.9升级到phonegap 3.5(无法找到项目目录错误) [英] How to upgrade from phonegap 2.9 to phonegap 3.5 (project directory could not be found error)

查看:140
本文介绍了如何从phonegap 2.9升级到phonegap 3.5(无法找到项目目录错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序,我建立在PhoneGap 2.7.I安装phonegap 3.5使用cmd,并尝试升级一个应用程序如此处所示





但它不显示如何从2.7直接升级到3.5

解决方案

我不认为phonegap平台更新适用于从3.x以前的版本升级。



/ cordova cli工作时必须检测具有3.x项目结构的项目。



要在2.x中升级项目,必须



  • 安装phonegap或cordova cli(您似乎已经做了,但如果你不打算使用phonegap build ,我建议你使用
    cordova而不是phonegap。如果没有,请在接下来的步骤中通过phonegap
    替换cordova)

  • 打开cmd并cd到您要放置项目的文件夹

  • 从您的旧项目中的www文件夹创建新项目



    cordova create nameforprojectfolder com.test.app Testapp --copy- from = pathtooldwwwfolder


  • 将当前目录更改为新创建的文件夹


  • 平台:



    cordova平台在cordova / phonegap 3.x中添加Android


  • 默认情况下,您必须添加您使用的所有插件:



    cordova插件添加uri.of.plugin


  • 自定义config.xml到您的需要


  • 创建android项目(这将在平台/ android文件夹中创建文件)



    cordova build android


  • 您可能需要在platforms / android / AndroidManifest.xml中自定义AndroidManifest.xml



现在您可以使用CLI来处理您的项目。


I have an android application that i built on PhoneGap 2.7.I installed phonegap 3.5 using cmd and tried to upgrade an app as shown here

How do I upgrade Phonegap in my Phonegap app?

But when i do it using cmd it gives me the following error:

Unlike phonegap 3.5 the android application that I built in PhoneGap 2.7 does not have a platform folder.So what am I supposed to?and how can I verify if it is upgraded or not?

I had also seen these phonegap documentation

http://docs.phonegap.com/en/3.5.0/guide_platforms_android_upgrade.md.html#Upgrading%20Android

But It does not show how to directly upgrade from 2.7 to 3.5

解决方案

I don't think phonegap platform update works for upgrading from something older than 3.x.

For phonegap/cordova cli to work it has to detect a project with the structure of 3.x projects.

To upgrade your project in 2.x you have to

  • install phonegap or cordova cli (which you seem to already have done, but if you don't plan on using phonegap build, I suggest you use cordova instead of phonegap. if not please replace cordova by phonegap in next steps)
  • open a cmd and cd to a folder in wich you will want to put your project
  • create the new project from the www folder you had in your old project:

    cordova create nameforprojectfolder com.test.app Testapp --copy-from=pathtooldwwwfolder

  • change current dir to the newly created folder

  • add the android platform:

    cordova platform add android

  • in cordova/phonegap 3.x no plugin is added by default so you will have to add all the plugins you use :

    cordova plugin add uri.of.plugin

  • customize config.xml to your needs

  • build the android project (this will create files in the platforms/android folder)

    cordova build android

  • You may need to customize AndroidManifest.xml in platforms/android/AndroidManifest.xml

Now you can use the CLI to work with your project.

这篇关于如何从phonegap 2.9升级到phonegap 3.5(无法找到项目目录错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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