Tuesday, December 25, 2012

cordova 2.2.0 messages.slice error in eclipse (android)

When using cordova 2.2.0 in eclipse for android development if you see following error

TypeError: 'undefined' is not a function (evaluating 'messages.slice(0, spaceIdx)') at file:///android_asset/www/cordova-2.2.0.js:1113

No need to worry, just do the following

Change line 1101

messages = messagesFromNative.shift();
to
messages = messagesFromNative.shift() + '';