Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhoneGap Developer - App does not show latest changes #287

Open
flyonthenet opened this issue May 21, 2015 · 79 comments
Open

PhoneGap Developer - App does not show latest changes #287

flyonthenet opened this issue May 21, 2015 · 79 comments
Labels
Milestone

Comments

@flyonthenet
Copy link

After last PhoneGap update, changes are not automatically transferred to Phonegap Developer App.
We have to close and restart the App to changes take effect.

This is very annoying :-(

Server platform (Phonegap serve): Windows Server 2003
Client: Adroid 5.1 (Nexus 5)

@timkim
Copy link
Contributor

timkim commented May 21, 2015

It takes a little bit for the new changes to update the app now (we changed some things internally). Give it a few more seconds to see if it updates. Over time we should be able to get the speed of the updates back to what they were.

@donovan-graham
Copy link

I'm having same issue on MacOSX + Samsung Galaxy S4, using phonegap serve from command line. Changes never propagate onto phone, so I'm having to manually restart after each change.

@Bushjumper
Copy link

+1

@flyonthenet
Copy link
Author

@timkim After some tests, if I run phonegap serve with no arguments, the App never updates.
If I run phonegap serve --autoreload the App gets updated after a while (about 1 minute)
If I open localhost:3000 in a standard browser, changes are immediate.

When loading, now seems that PhoneGap Developer downloads the entire app in a zip (takes more time to start)

There's some way to restore the previous behavior? It was so handy! :-)
Thanks in advance

@timkim
Copy link
Contributor

timkim commented May 22, 2015

Hrm - well it looks like we have some kinks to work out. Ya, we changed the PhoneGap Developer App to download the entire app as a zip - it fixed issues concerning AJAX, certain api calls and such, but it seems like performance took a hit.

To restore the previous behaviour would require a downgrade of the app to 1.4.0.

@itwseood
Copy link

@timkim we have performed some tests with the following configurations:

  • win 8, PhoneGap Cli (5.0.0-0.28.0) and iPad Mini, iPhone 6, Samsung Galaxy S3 - all of these with the latest release of PG Developer App.
  • Yosemite os, PhoneGap Cli (5.0.0-0.28.0) and iPad Mini, iPhone 6, Samsung Galaxy S3 - all of these with the latest release of PG Developer App.

I am sending some insights, hope those will help:

  • An app update after a file save usually takes ~30s with the download.
  • Very common scenario is the download to fail, when a file is updated. http://screencast.com/t/Q35v1eJ0g47J - This is solved when we terminate the app server, close the developer app and then restart the app server and the dev app. Then in few saves we often end up to the same case.
  • Often the app gives Alert that is "Unable to download the archive from the server. Please upgrade the PhoneGap Cli or check your network settings". Since we did not change anything in our dev network environment after the latest update and the CLI is up to date, I guess the reason for download fail is not related to both of the reasons.
  • On some point I've got this error that might be useful, although it might not be directly related (win 8 environment)l:
fs.js:568
  function strWrapper(err, written) {
                ^
Error: EMFILE, too many open files 'C:\Users\XXX\AppData\Roaming\npm\node_mod
ules\phonegap\node_modules\connect-phonegap\res\middleware\deploy.js'
    at Error (native)
    at Object.fs.openSync (fs.js:502:18)
    at Object.fs.readFileSync (fs.js:354:15)
    at injectScript (C:\Users\XXX\AppData\Roaming\npm\node_modules\phonegap\n
ode_modules\connect-phonegap\lib\middleware\zip.js:40:34)
    at InjectHTML._transform (C:\Users\XXX\AppData\Roaming\npm\node_modules\p
honegap\node_modules\connect-phonegap\lib\middleware\zip.js:62:68)
    at InjectHTML.Transform._read (_stream_transform.js:179:10)
    at InjectHTML.Transform._write (_stream_transform.js:167:12)
    at doWrite (_stream_writable.js:301:12)
    at writeOrBuffer (_stream_writable.js:288:5)
    at InjectHTML.Writable.write (_stream_writable.js:217:11)

Hope this helps! Let me know if we can help performing some additional tests if needed. Our team likes PhoneGap (and Cordova) we have active projects using it and indeed the Developer App saves huge amount of time. I'm sure these glitches with the the DevApp update will be solved and this toll will continue to be as fast and smooth as before and better in form of possibilities.

You've mentioned downgrade to 1.4.0 - is the previous version available somewhere to get as PG Dev App?

@itwseood
Copy link

Additional insight that might be helpful. Noticed that if using MAC and the app is open in BOTH the browser (localhost:3000) and via the iOS Phonegap Developer app, the extraction of the app never crashes and reloads the app preview appropriately.

@Bushjumper
Copy link

@timkim Any progress on this? If not, could you please provide a way to downgrade? Thanks

@rodrigozr
Copy link

+1
Also, I would like to add that "console.log" output also stopped working in the latest version. Do anybody have a link to the old APK?

@mwbrooks
Copy link
Collaborator

Hey @flyonthenet @donovan-graham @itwseood, thanks a lot for all of the details! Seriously, it's hard to recreate various environments using various devices, so this kind of testing and reporting helps a lot.

I've noticed that #292 is also having issues on an iPhone 5. Referencing it here so that the Github issues link to each other.

We'll need to dive into this issue more seriously, since it's not a trivial fix. I totally understand if you need to downgrade in order to get back into dev-mode. We archive all of our releases inside of the repository and you can find the Android releases here. You should be able to install the Android releases as long as third-party apps are enabled on the device. iOS obviously isn't as simple.

@flyonthenet
Copy link
Author

Hi @mwbrooks @timkim

This is what I can report after some days of developing with the new PhoneGap.

  1. Seems that some files are cached. The App gets auto-reloaded fine (I see HTML changes) but scripts (frequently) are old. So, when my App is not working as I expect, I don't know if it's a fault in my code or a cache related problem. I usually place a huge alert in JS code, and if not shown, I insist on reload.

  2. When I save JS or CSS, changes are not propagated to the App. I have to save some HTML related file to get my App updated. Sometimes this is not sufficient, so I have to close and reopen PhoneGap Developer. May this can be related to same cache issue?

Do you think that <meta http-equiv="pragma" content="no-cache" /> will help to mitigate this?
Or how I can tell PhoneGap to turn off any caching?

@rodrigozr Actually I'm using console.log with no problems. Have you tried to run phonegap serve --autoreload?

Have a nice day
D.

@sarvansri
Copy link

Hi,
i am new in phonegap, i am developing a simple app in cordova.

I have auto reload issue in phonegap developer app. If i change css, html or javascript files in project folder, its not updated in developer app, i don't have a line "200 /autoreload" in cmd windows. just i have file changed comments only in cmd windows.

please let me know the exact issue & what i should update ?

@jdillon11
Copy link

I noticed this problem a few weeks ago when I updated to the newest version of PhoneGap, so I waited a few weeks, uninstalled PhoneGap, created a new project, updated the developer app on my phone, and everything still seems broken. This is really disappointing and frustrating as I can't really get the work done I need to. Is there a timeframe on when this will be fixed, or any other updates on the problem?

Thanks,
Josh

@mwbrooks
Copy link
Collaborator

Hey @jdillon11,

Yea, this is a frustrating issue. We've got a patch waiting in the Apple submission queue and we'll release it once it's approved. The patch helps address some reload issues, where the previous content was cached. We're now trying to diagnose the connection (or download error) message that users are seeing.

@timkim
Copy link
Contributor

timkim commented Jun 18, 2015

Hi all,

Our update to fix the autoreload issue should now be up. Please update your app and see if the autoreload feature works for you.

@lucifertran
Copy link

Hi,

I still face problem with HTML not reload. I tried to fixed one issue by modifying the html, turn out it did not work out. So I switch back to the old one, and Phonegap app did not update at all.

Anyone facing the same problem?

@vrathnam7
Copy link

I am also still facing this issue from both the CLI and the desktop application from my Mac. The three finger tap and four finger tap also do not work. I am using the most recent version of phonegap. Any updates on this?

@tanasebutcaru
Copy link

Same issue here! Using CLI on Linux with latest phonegap / cordova / nodejs versions.
Tested on a Xperia Z3c.

@owenconti
Copy link

Having the same symptoms as @vrathnam7 - No automatic refresh, no 3/4 tap gestures working. Only way to reload the app is to force quit the Phonegap Developer App and reopen it. I have the most recent version of the Phonegap CLI and Phonegap Developer App as of today (Aug 15, 2015)

@Xyclade
Copy link

Xyclade commented Aug 18, 2015

Same here using Mac OS Yosemite, the IOS and Android app (latest versions)

@MilosRasic
Copy link

Hi. I have a similar problem, except that it occurs one one machine only (work) and the app is working fine on another (home). Both computers are running Windows. The client is Android. Any news or workarounds for this problem?

@seltzlab
Copy link

Same here with Ubuntu + CLI, Phonegap 5.2.1 and latest Android app

@mwbrooks mwbrooks modified the milestone: Backlog Sep 11, 2015
@mwbrooks mwbrooks removed the backlog label Sep 11, 2015
@indice
Copy link

indice commented Sep 23, 2015

+1

@mwbrooks mwbrooks added the bug label Sep 23, 2015
@imovertheinternet
Copy link

+1

1 similar comment
@gecsafunk
Copy link

+1

@timkim
Copy link
Contributor

timkim commented Jul 11, 2016

Hi @jensbits

Yes, autoreload should work on other pages other than index.html. Did you include a script reference to cordova/phonegap on your other pages?

@jensbits
Copy link

jensbits commented Jul 11, 2016

@timkim Yes, I do. So I checked if there was a difference in the code where cordova was referenced and I found this:

On the index.html I had:

<script type="text/javascript" src="cordova.js"></script>

And, on the other pages, I had this:

<script src="cordova.js"></script>

After adding type="text/javascript" to all the other references, everything started auto-reloading again on the other pages.

Thanks for making me look a little harder.

@m0uneer
Copy link

m0uneer commented Jul 25, 2016

This problem happened with me but when I executed the build command with --verbose, the problem was just wrong permissions. So, make sure that the current user that run the command has the permissions to write into the app directory.

@illiniguy
Copy link

+1

Pretty sure this broke again in a recent build. Cannot auto refresh or use any tap gestures whatsoever. iOS and Android. Testing with default apps created with the desktop app.

@jksoegaard
Copy link

Also broken here when using the current 0.3.4 build from phonegap.com. I have installed on a fresh Mac and iPhone (haven't had Phonegap Desktop/Developer on them before) - and they do not auto refresh the content. Viewing the site in Google Chrome on the desktop auto refreshes properly.

@renalpha
Copy link

Same here, IOS. Installed it 5 minutes ago.

@surajpindoria
Copy link
Collaborator

Hi @illiniguy, @jksoegaard, @renalpha,

Version 0.3.4 of the desktop app has a bug related to the updated connect-phonegap module that is causing these problems in the developer app. We already have a fix and will release version 0.3.5 soon. In the meantime, using the CLI and running phonegap serve will work properly.

@surajpindoria
Copy link
Collaborator

Version 0.3.5 of the desktop app has been released

@rxtcreagh
Copy link

Installed 0.3.5 an hour ago and for some reason it doesn't see my changes. Do I need to do something else to get my changes to appear? Running the PhoneGap desktop app and using iPhone 6.

@jksoegaard
Copy link

Works for me now with 0.3.5!

@rxtcreagh
Copy link

I have had some luck but mostly I have to close the browser or iPhone app, quit PhoneGap and restart for any changes I make. I've tried stopping the app and starting it but so far that hasn't seemed to help. jksoegaard are you seeing the changes work as you save them and are you running the browser or the app? Thank you, tim

@jksoegaard
Copy link

Yes, the display updates as I save the HTML/JS files. It works for me both with the browser and the app.

If you have to restart the PhoneGap Desktop program, you're having a different problem than the one I was having. I had to restart the app.

@rxtcreagh
Copy link

If I make any change, say add a

I get this message

Error:Not found

I then have to close everything, restart phonegap and relaunch the browser or app. So I end up having to quit and relaunch about 40-60 times a day making it difficult to test things. I must have a setting wrong it sounds like you don't have the problem.

-tim-

@hellboywar
Copy link

I have phonegap-cli 6.3.0 installed and autoreload on device works only if cordova.js added in html exatly that way:

<script type="text/javascript" src="cordova.js"></script>

Any other way is broken

@asteriskman7
Copy link

I had this problem from a web browser after I accidentally ran phonegap serve as root. That resulted in files in the platforms directory being unwritable by a non-root user. Removal of everything in platforms as root resolved the issue and the web browser now sees updates correctly.

@keymarkstuart
Copy link

keymarkstuart commented Sep 30, 2016

@hellboywar is right for me. EXACTLY LIKE THIS in the index.html works other suggestions do not

<script type="text/javascript" src="cordova.js"></script>

@kalliste
Copy link

kalliste commented Oct 6, 2016

Mine was broken by the Content Security Policy. Fixed by setting it to something insecure:
meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"

@Radivarig
Copy link

Reloading to work in my case:

  1. cordova.js script has to be without attributes like @hellboywar said, (at least without charset="utf-8")
  2. cordova.js script has to be last. Otherwise a script after it bundle.js (webpack) was not even loaded.

My working template repo

@Papipo
Copy link

Papipo commented Dec 14, 2016

Also, I was wondering if not downloading a ZIP would allow webpack-dev-server to be used directly as a development setup.

@ghost
Copy link

ghost commented Apr 22, 2017

lol, having to write
<script type="text/javascript" src="cordova.js"></script>
was actually it.
I don't include the type anymore, since it's the default in the HTML5 spec anyway:
https://www.w3.org/TR/html5/scripting-1.html#attr-script-type

So can this please be fixed in one of the next releases? Writing
<script src="cordova.js"></script>
shouldn't break anything.

@flyonthenet
Copy link
Author

For me, things are running pretty good with latest version of CLI and PhoneGap Developer.
The apps are realoding almost always.
I suggest to close this (old) bug.

@Hissvard
Copy link

It's old but it does keep coming back from time to time, I got here via Google because I was having the same issue a few minutes ago :/

My solution was simply moving the folder.
I'd accidentally cloned the repo inside Program Files and it wasn't working - moving it back to the Desktop actually got everything running again.
Which leads me to think @m0uneer's hunch about permissions is one of the most likely causes.

@ivangarcia88
Copy link

+1

@yatima1460
Copy link

I have the same problem and the simplest solution is to just remove and re-add the platform you are working with.

@Shivang44
Copy link

@hellboywar Your solution worked for me. Including it like this:

<script type="text/javascript" src="cordova.js"></script>

Is required. This is a little annoying because I wanted to require cordova.js as a module with requirejs, but this works for now. If anybody has found a workaround for this with requirejs please let me know!

@mmtechslv
Copy link

Editing index.html with Kate does update the App but if you use Gedit such problem does not exists.

@conradkirschner
Copy link

as nobody said that before ....

you should: Including it like this:

<script type="text/javascript" src="cordova.js"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests