rebuild or update command

2,782 views
Skip to first unread message

Paul b

unread,
Aug 28, 2013, 2:02:30 AM8/28/13
to phon...@googlegroups.com
Hi,

Does anyone know if its possible to rebuild a platform?

I have had the following experience and was wondering if maybe there was something i was missing.

The following was done using the command line

  1. Created project (phonegap create app com.myapp.app app)
  2. built for ios (phonegap build ios)
  3. added plugins (phonegap local plugin add https://<insert_plugin_here>.git)
  4. tried to run ios simulation through xcode but would not run due to missing plugins??

  1. created new prject
  2. added plugins first
  3. built for ios (phonegap build ios)
  4. ran simulation without errors
  5. deleted platform/ios folder
  6. built for ios (phonegap build ios)
  7. ran simulation WITH errors about missing plugins

So i am just wondering if there si a way to:
A) properly delete folders using some command line command
or
B) rebuild the project

Thanks for any help

using phonegap version 3.0.0-0.14.3 (installed yesterday via node) if it helps

WebSteve

unread,
Aug 29, 2013, 3:55:59 PM8/29/13
to phon...@googlegroups.com
A) You can delete folders using Terminal via the rm command, but it's easier to just right-click and send to Trash. 

B) After A, just do a phonegap build again.

Paul b

unread,
Aug 29, 2013, 8:16:07 PM8/29/13
to phon...@googlegroups.com
Hi WebSteve

Thanks for the reply.

What you suggest is what I have tried to do i.e. right click, move to trash and then phonegap build ios. However, when the build completes, the plugins are missing from the ios platform.

so...@instinkt.dk

unread,
Sep 19, 2013, 7:07:34 AM9/19/13
to phon...@googlegroups.com
I'm having same problem. I've run "phonegap build ios" a couple of times. After changing some info in config.xml (id, version, description and author), the plugins does not get compiled correctly, as PG fails to populate the plugins folder. Here is a screenshot of the two compilations before and after I changed the info in config.xml: https://dl.dropboxusercontent.com/u/419676/pg.png

I fixed it by manually importing the plugins into the plugins folder. After doing "phonegap build ios" again the pluginsfolder is still intact. Hope this helps you abit, even though it's been a few weeks :)

Dan Moore

unread,
Sep 19, 2013, 8:40:53 AM9/19/13
to phon...@googlegroups.com
Hi Paul,

I deal with this issue on Cordova, but I think it might be helpful (as long as you don't have too much customization you are manually doing in Xcode).

I add and remove the platforms:
cordova platform add ios
...
close Xcode project
cordova platform rm ios
cordova platform add ios

And have a hook that fires on after_platform_add that adds all the plugins I want.

    #!/bin/sh
    for fileurl in "http://github.com/foo/barplugin ...
        cordova plugin add $fileurl;
    done

I realize this is more of a workaround than an answer to your original question, but thought it might be useful.  It looks like you are using phonegap cli in local mode, so this should work--I don't think you have hooks in phonegap build.

--
Dan Moore
Developing with Cordova CLI
https://leanpub.com/developingwithcordovacli

Evan Donn

unread,
Sep 21, 2013, 11:40:27 PM9/21/13
to phon...@googlegroups.com
I've run across the exact same issue. It appears you can build once successfully, after that it never completely merges things like plugins or config file changes fully. It pretty much makes the build command a one-shot thing, from that point on anything else you need to do has to be done directly in the platform directory - which seems to make the entire merge/build cli workflow useless. 

Paul b

unread,
Oct 9, 2013, 1:56:33 AM10/9/13
to phon...@googlegroups.com
Hi All,

Thanks for all your replies. I've found so far that it's pretty much as Evan put it, "a one-shot thing". I've started using a script to automate creating a new project i.e. creating a folder, importing plugins, the initial build, etc. I run this if i need to add something and end up copying across all the web based files. So basically, it's a new project. I wonder if the guys at phonegap are aware of this??

I'll try out Dan's suggestion and see if that helps, although losing any xcode customisation would not be a pity.

I'm not sure if this is a problem for creating android builds of the same project.

Thanks again,
Paul.

C SBCERA

unread,
Jan 2, 2014, 7:59:58 PM1/2/14
to phon...@googlegroups.com
Just discovered this too. I deleted my iOS folder and did a build at it is messed up. All my plugins are in my root folder but they never go back into the iOS project. Has anyone figured out a way to simply add your plugins that are in the root folder back into a project?
 

Paul b

unread,
Jan 5, 2014, 5:58:42 PM1/5/14
to phon...@googlegroups.com
Hi C Sbcera,

I still haven't found any alternative to rebuilding the entire project. Unless the new version of phonegap fixes this. I haven't had a chance to download and try yet.
Reply all
Reply to author
Forward
0 new messages