How to upgrade from phonegap 2.9 to phonegap 3.5 (project directory could not be found error)

前端 未结 1 1324
时光取名叫无心
时光取名叫无心 2021-01-26 00:57

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 P

相关标签:
1条回答
  • 2021-01-26 01:47

    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.

    0 讨论(0)
提交回复
热议问题