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

Already on GitHub? Sign in to your account

Socket.io client error with phonegap - android build #563

Closed
tontione opened this Issue Jul 11, 2013 · 3 comments

Comments

Projects
None yet
4 participants

I try to build an app for android with phonegap, but i get an error into the socket.io.js client file :

E/Web Console(642): Flash Player >= 10.0.0 is required. at file:///android_asset/www/js/lib/socket.io.js:2650

I don't use any flash feature, so what's the matter !?

I´m having the same problem. Did you find a solution?

tontione commented Aug 6, 2013

No solution for this, but finally it works, even with this error (i had other problems).

Found the solution for this ... modify consoler.js under the phonegap modules (in my mac, it was under /usr/local/lib/node_modules/phonegap/node_modules/connect-phonegap/res/middleware) to the following:

(You need to load socket.io through AMD rather than directly)

<script> (function(window) { require(['/socket.io/socket.io.js'],function(io){ var socket = io('http://' + document.location.host); var previousConsole = window.console || {}; window.console = { log:function(msg){ previousConsole.log && previousConsole.log(msg); socket.emit('console','log', msg); }, warn:function(msg){ previousConsole.warn && previousConsole.warn(msg); socket.emit('console','warn', msg); }, error:function(msg){ previousConsole.error && previousConsole.error(msg); socket.emit('console','error', msg); } } }); })(window); </script>

@rauchg rauchg closed this Nov 25, 2014

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