I'm currently using PhoneGap 2.7.0 on my project and code runs without error on iOS.When I try to run the same code on android (with the exception of the Cordova javascript file, which I know is different for Android) I'm getting this error:
05-21 22:02:25.630 1663-1663/com.###.### D/Cordova: onPageFinished(file:///android_asset/www/index.html)
05-21 22:02:25.640 1663-1663/com.###.### D/CordovaLog: Uncaught Function required as first argument!
05-21 22:02:25.640 1663-1663/com.###.### E/Web Console: Uncaught Function required as first argument! at file:///android_asset/www/cordova-2.7.0.js:627
Here is the JavaScript I'm using in index.html:
<script type="text/javascript">
var app;
document.addEventListener("deviceready", function()
{
app = new AppWrapper();
}, false);
</script>
I'm not sure what the issue is.I had this issue before but it has resolved itself in the past (black magic?).Any help would be greatly appreciated.
After employing Ripple to debug this issue (highly recommended), I found a pointer to an undefined function being applied to an event listener (so, not specific to the deviceready call).
For future developers: check to make sure all of your "addEventListener" calls are pointing to existing functions. Seems obvious, but it happens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With