PhoneGap build is not updating all of my files when it runs.

  • 3
  • Problem
  • Updated 4 years ago

My local html project is structured like such:

www
|_ Assets
   |_css
   |_Images
   |_Scripts
      |_trees.js
|_ config.xml
|_ icon.png
|_ index.html
|_ splash.png


Here's what I'm experiencing. I make a change to trees.js and then zip up my html project into www.zip. I upload this file to my PhoneGap Build app using the update code button. PG builds for all the platforms. However when I download the Android apk file (this is the only one I've tested b/c it's the one I know the most about) and rename it to .zip and inspect the files in it, my trees.js file does not have the changes I upload. I've verified that the www.zip file I uploaded does contain my javascript changes.


I also have Hydration turned on. I first started noticing this when I made changes to the project, uploaded, then tested the changes on an Android device and noticed that things still weren't working. In my experience changes to index.html do get updated after PG build runs, but not changes to trees.js. Maybe b/c it's buried under the folders Assets/Scripts?


Is this a bug or is my project structured incorrectly?

Photo of notorious2tall

notorious2tall

  • 8 Posts
  • 1 Reply Like
  • confused

Posted 8 years ago

  • 3
Photo of notorious2tall

notorious2tall

  • 8 Posts
  • 1 Reply Like
Did a little more testing and was able to get PG build to include my javascript changes if I turn off Hydration.
Photo of notorious2tall

notorious2tall

  • 8 Posts
  • 1 Reply Like
This is still an issue. Rebuilding my project does not pick up my changes. The downloadable apk file doesn't contain any of the changes I made in my uploaded zip.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
When you say this is still an issue -- do u mean with or without Hydration?

Here's how it should be working right now:

1. Upload initial app, enable hydration -- builds all binary apps.

2. Upload new updated app -- hydrates only. Binaries will still have original version.

3. Re-run app -- hydration should indicate updates, and download the updated files. Again, at this point, if you re-download the binary app files, they will stil have the original app inside.

Note: we are aware of a couple of issues with Hydration:
- hydrated app will not run (blank gray screen) on some older Android versions
- Android webview will sometime cache images (and possibly other files), and so some hydration updates might not appear

Fixes for both of these issues will be deployed very shortly.
Photo of Jan Filipowiak

Jan Filipowiak

  • 7 Posts
  • 0 Reply Likes
There's definitely something wrong! Im using phonegap Build and i have a strict deadline for the app. 2 weeks ago app stopped updating js files on PB server. Everytime i download the app with qr code hydration or no hydration it shows me bugs in my app i've fixed 2 weeks ago.

I even deleted the app from PB and created it with different id, provisioning profile and still it shows me content before my updates.

Please advise!
Photo of Jan Becker

Jan Becker

  • 1 Post
  • 0 Reply Likes
Same Problem here, cant get my app working!
None of the changes in the .js files are reflected in the app. I tried to turn hydration off and on a couple of times.

Please fix, spend a whole day figuring what I'm doing wrong!
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Not sure what exactly is happening here, but after deleting your app from PhoneGap Build, and then recreating it, there's really no way that Build could be using your old files. So ... that leads me to think that whatever method you're using on the client side to package and upload your app is not updating.

Please share:
Your app IDs
Your upload method (dreamweaver, git repo, zip upload via web interface, api, etc.)
The device you're testing on
Photo of Simon King

Simon King

  • 2 Posts
  • 0 Reply Likes
I'm having a similar issue.

I'm pulling my app into PhoneGap Build from GitHub.

Changes I've commited can be seen in GitHub but when I pull the code into my app in phonegap build and rebuild, then install onto my android device via the QR code, my changes do not appear. Even changes to the index.html

Yesterday it was all working perfectly but then all of a sudden, any changes stopped appearing in my app.

I've tried deleting the app in PhoneGap and creating a new one and uninstalling the app off the phone and reinstalling fresh.

Appears to be an issue with PhoneGap not pulling the latest commit from GitHub; seems to be stuck on pulling the same commit rather than the latest OR could it be the app is caching the page so the changes don't appear (although I also deleted the app off the device and reinstalled).

App ID is 368716
Upload Method: GitHUb https://github.com/simonking76/pokerm...
Device: Android.
Photo of Simon King

Simon King

  • 2 Posts
  • 0 Reply Likes
resolved it.

I had files in my app that shouldn't have been there - specifically a zip file.

this must have caused the build to fail, even though there were no errors or indication that the build failed, causing the confusion.

all part of the learning curve I guess!
Photo of dmlcreative

dmlcreative

  • 30 Posts
  • 0 Reply Likes
I'm having a similar issue. I update something as simple as a font-size in my CSS file, and when I rebuild the app, this does not get updated. I can see the change is in the repo on github.com, but if I inspect the APK, it still has the old code.

Any clue how to get the build to use the most currently updated versions of all my assets like CSS, JS, index.html, etc?
Photo of dmlcreative

dmlcreative

  • 30 Posts
  • 0 Reply Likes
I am PGB App #1441164
Photo of Jonny White

Jonny White

  • 2 Posts
  • 0 Reply Likes
Same issue here. Zip is not updating no matter what I try. (hydration on and off, removing the config.xml file and it doesn't complain)
Photo of Jonny White

Jonny White

  • 2 Posts
  • 0 Reply Likes
I logged out and then in again and it works now. Not sure if logging out was related or if they fixed something in the interim
Photo of dmlcreative

dmlcreative

  • 30 Posts
  • 0 Reply Likes
Well, I tried logging out and back in and rebuilding with no luck. It is still keeping all the old code.
Photo of dmlcreative

dmlcreative

  • 30 Posts
  • 0 Reply Likes
Solved it. If anyone runs into the issue of running "update code" and nothing gets updated, you need to run 'phonegap build' again. I did this, then hit the update code button and the new code showed up.
Photo of Sudarsan Raju

Sudarsan Raju

  • 1 Post
  • 0 Reply Likes
I faced the same issue
When i am try to build with xcode my code dint update
But when i tried with terminal it worked .
Photo of othmane senouci

othmane senouci

  • 5 Posts
  • 0 Reply Likes
On MAX OS X you can use the terminal to force phonegap to update JS and HTML files.

Just cd to your app's directory and type the following command:

phonegap prepare ios
Photo of Mathias Banda

Mathias Banda

  • 5 Posts
  • 0 Reply Likes
If this is still an issue for anyone here is how to solve it:

1. Delete the current project zip
2. On the command line in the project folder run this: Cordova build
3. Now create the project zip,
4. Logon to your phonegap account, upload /update code and build

The key to making it work is is step 2
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
The client side code is on my USB stick or on a client's drive. I edit the files with my favorite code editor. Some files are app specific, others are used throughout a collection of apps.
Server side code is on the server, and is either edited locally or remotely, depending on how much needs to be done.

The point was, that you seem to think that developers (users of Phonegap Build) have something like Phonegap, SDK platforms and Cordova projects installed. The whole point of Phonegap Build is that Cordova projects, platform installations and such are not necessary at all. PGB developers just code away, not hampered by any project structure requirements.
(And of course that means that 'cordova ...' commands are not available and not necessary.)
Photo of Mathias Banda

Mathias Banda

  • 5 Posts
  • 0 Reply Likes
You're absolutely right that's what I assumed. I have had the same problem for weeks and I have the ionic & Cordoba framework installed locally. So when I test the app everything is up to date. But zip the project and upload it to phonegap the build is weeks out of date. But now if I do a Cordova build before zipping and uploading the project to phonegap it is 100% upto date. I think that's the same problem

Try removing platforms from your project (if you can) save and add them back in.
(Edited)
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
My guess is that you are zipping up the whole Cordova project, or at least you don't move the config.
PGB expects a different structure (which you might also not be aware of).
Photo of Mathias Banda

Mathias Banda

  • 5 Posts
  • 0 Reply Likes
PGB has an api - my knowledge goes thus far.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
True. But that's the remote build feature of the CLI, which is not considered "using Phonegap Build" here at this forum.