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

Issues after application autoreload (1.4) #244

Closed
wclr opened this issue Dec 1, 2014 · 17 comments
Closed

Issues after application autoreload (1.4) #244

wclr opened this issue Dec 1, 2014 · 17 comments

Comments

@wclr
Copy link

wclr commented Dec 1, 2014

After autoreload (if some watched file changed) OR after restart of phonegap serve application running on the device reloads index.html, and there is a couple of bugs that were noticed:

Sometimes (accidentally, but almost always in my case):

  1. deviceready event is not firing (on Android 4.1)
  2. Some plugins (particullary file and file-transfare) are not available. (iOS7)

If to shutdown the app on device and lauch it again for first time everyting works fine (deviceready and plugins are available) after auto reload the app is broken.

I encountered this on phonegap CLI 3.6 and 4.1 running on Windows 7x64 and on OS7 and Adroid 4.1 devices.

I don't know if its a bug of 1.4, currenty I didn't try on previous version of the app.

@vancata
Copy link

vancata commented Dec 2, 2014

Same with me. Phonegap 3.6.3 and the new phonegap developer app result in deviceready not fired on my android 4.1 (Galaxy S3 Mini).

Windows 7x64

@vancata
Copy link

vancata commented Dec 2, 2014

I just updated phonegap to latest version: 4.1.2-0.22.9 and the issue disappeared.
Note: I had to use npm install instead of npm update as the latter did not update phonegap.

@mwbrooks
Copy link
Collaborator

mwbrooks commented Dec 2, 2014

There is a major known npm 2.x issue when using npm update -g <package>. It's best to always use npm install -g <package>, even when you are updating from a previous version.

@vancata glad to hear that you got it going!

@wclr
Copy link
Author

wclr commented Dec 3, 2014

Well I use npm 1.4.3 and CLI 4.1.2-0.22.9.
I have to restart application on the device to get rid of the problem.
I don't think that the problem in server, doesn't it look like a client bug, no?

@screendriver
Copy link

Same here. There is no autoreload if I build this app with phonegap build android. But if I install the app from Google Play everything works (except 3rd party plugins that I want to use)

@mwbrooks
Copy link
Collaborator

mwbrooks commented Dec 8, 2014

@screendriver actually, autoreload is only a feature of the PhoneGap Developer App and the phonegap serve command. It's not included in compiled applications (although you could do that yourself with livereload).

@whitecolor Are you experiencing the problem when running $ phonegap serve?

@screendriver
Copy link

@mwbrooks I know this. You misunderstood: I compiled the phonegap developer app by myself and included some 3rd party Plugins that I need. Then I installed it on my android device and run phonegap serve on my PC. The same procedure as with the usual phonegap developer app from Google Play. The only difference is that with my self compiled phonegap developer app the autoreload is not working. I think it is the same issue like @whitecolor

@mwbrooks
Copy link
Collaborator

mwbrooks commented Dec 8, 2014

@screendriver yep, I totally misunderstood!

Hmmm... I'm not sure why your version is not working correctly. The PhoneGap CLI provides all of the logic for auto-reload. Before serving your app, it injects the auto-reload JavaScript, which pings the server. So as long as the access config.xml element is wide-open, you shouldn't run into any issues.

@screendriver
Copy link

@mwbrooks just try it yourself. Check out the master, run phonegap build android and deploy the resulting APK to your device. You will notice that autoreload is not working correctly. If you install the phonegap developer app from Google Play everything works as expected.

@mwbrooks
Copy link
Collaborator

mwbrooks commented Dec 8, 2014

@screendriver Oh, you're referring to the phonegap-app-developer:master branch? Unfortunately, that is using a new approach for syncing content and it isn't compatible with the master branch of the PhoneGap CLI.

Can you try checking out the 1.4.0-android-release tag? That uses the current approach and is the latest production code for Android.

As a backstory, we prototyped a new approach for delivering content from the CLI to the app. It was looking very good and we merged it into the master branch. Unfortunately, after merging we discovered a blocking issue in Android and had to rethink the approach. Today I'm actually reverting our changes to master, so that it's aligned with the latest code in the app store.

@mwbrooks
Copy link
Collaborator

mwbrooks commented Dec 8, 2014

@screendriver I've cleaned up the master branch to be an accurate representation of the production code. Sorry about the confusion and time lost! Let me know how it goes.

@screendriver
Copy link

It works. Thank you! The only issue I have: I can't use 3rd party plugins that I have installed. Is there any registration or something I have to add the plugins?

@mwbrooks
Copy link
Collaborator

@screendriver awesome!

I see you've created an issue (#252) to answer your next question. So I think it's safe to close this one off!

@whitecolor if you're still having this issue, feel free to drop a comment and I'll reopen it!

@wclr
Copy link
Author

wclr commented Dec 13, 2014

@mwbrooks Michael, I was trying to contact you about other issue by email, but wasn't succesfull to get the answer wan't it appropriate channel to contact you about PG related topic?

@wclr
Copy link
Author

wclr commented Dec 13, 2014

@mwbrooks I still have the same problem with autoreaload enabled. Do I have to update CLI or do to what?

@mwbrooks
Copy link
Collaborator

Hi @whitecolor, sorry about the slow e-mail response! I go through periods where I'm buried in e-mail and it's hard to keep up! I'll try to respond to you in a bit.

Generally, it's better to ask questions in the public, rather than private email. Usually if you have a question, then someone else has the same question as well. So, it's better to workout the solution in the public, so that others can find it later on.

For the autoreload issue, you'll need to update to the latest CLI (4.1.2-0.22.10) and the latest PG Developer App (1.4.0`). Let me know how it goes!

@wclr
Copy link
Author

wclr commented Dec 15, 2014

@mwbrooks ok, thanks, the email question was about Media Plugin (playback rate) and I failed to get any public response in its repo.

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

No branches or pull requests

4 participants