PhoneGap + JQM App breaks in Android 4.0.3

2019-07-11 13:44发布

问题:

I recently upgraded to ICS 4.0.3 and tried to deploy my PhoneGap (v 1.4.1) and JQM (1.1.0-rc-1) application but it breaks down after the first page load. There are two errors in the logcat that are giving me clues but I don't really understand whats going on.

First I get

 04-05 02:36:38.366: D/chromium(1335): Unknown chromium error: -6

followed by quite a few

 04-05 02:36:38.837: E/libEGL(1335): call to OpenGL ES API with no current context (logged once per thread)
 04-05 02:51:03.024: D/ShaderProgram(2887): couldn't load the vertex shader!

I don't know whats going on and I can see that the second page renders about 1/4 of the way through then nothing. This ran fine in all other android builds but fails on 4.0.3. in both emulator and actual device. I found a few similar questions saying its an error with chromium theres gotta be a work around or something. I atleast need to figure out if the culprit is JQM or the android browser or what elements are causing this error.

回答1:

I experienced something similar, jquery getScript was not working at all for Android 4 (and it worked for every other platform). I ended up replacing getScript with a simple javascript function found here (loadJs): Load External JavaScript File



回答2:

i also experiencing this issue and i found the problem.
it was because I used searches and hashes in my pages... meaning some_page.html?param=value
if you remove the parameter you won't get the error any more