Infinite loop - processMessage failed: invalid message: "" - when running PhoneGap application.

2,229 views
Skip to first unread message

IT

unread,
Jan 22, 2015, 9:42:38 AM1/22/15
to phon...@googlegroups.com
I am using PhoneGap 4.1.2-0.22.12 together with Ionic.
I am using 3 plugins: geolocation, file and camera.

I run "phonegap build android" to build the project. It is a test application, based on https://github.com/driftyco/ionic-starter-tabs.
I deploy the .apk to my smartphone, run the installation, open the app, it is not responsive, it is frozen.
When I host the contents of TestApp\platforms\android\assets\www on a local webserver, I see 4 popups (javascript alert()) and infinite entries:
processMessage failed: invalid message: ""
in the Google Chrome console.

Screenshots can be seen here:

I tried searching the error message on google, did not come up with anything good enough to fix the problem. The error message comes up in topics about older PhoneGap builds, but appears to have been fixed.


Any suggestions on how to approach this problem?

IT

unread,
Jan 22, 2015, 10:24:19 AM1/22/15
to phon...@googlegroups.com
Removing plugins folder and files cordova.js and cordova_plugins.js gets rid of the popups. So I know this issue is related to plugins.

IT

unread,
Jan 23, 2015, 5:51:05 AM1/23/15
to phon...@googlegroups.com
Scrap that, problem can be reproduced by these steps, in a brand-new project:

cordova create TestApp
cd TestApp
cordova plugin add org.apache.cordova.camera
cordova plugin add org.apache.cordova.geolocation
cordova plugin add org.apache.cordova.file
cordova platform add android
cordova build android

Ronald K

unread,
Jan 23, 2015, 8:34:55 AM1/23/15
to phon...@googlegroups.com
You need to add the platform before any plugins. So first run 'cordova platform add android' , and then 'cordova plugin add [..]'

Op vrijdag 23 januari 2015 11:51:05 UTC+1 schreef IT:

Kerri Shotts

unread,
Jan 23, 2015, 3:54:36 PM1/23/15
to phon...@googlegroups.com
Shouldn't need to though -- that's why the plugs get added to the project whenever you add it. In other words, the platform is a build artifact (-ish), and shouldn't need to be present when plugins are added. 

@IT: Does the issue occur only with all three plugins? If you take one out, does the issue go away? Also, try @Ronald's suggestion -- if you add the platform first and the the plugins, do the errors go away?
Reply all
Reply to author
Forward
0 new messages