0
votes

I have been banging my head trying to solve this problem.

I've created a blank starter app with Ionic and added no additional plugins.

Whenever I emulate on OSX I get these console errors:

exeption nativeEvalAndFetch : TypeError: cordova.require is not a function. (In 'cordova.require('cordova/exec')', 'cordova.require' is undefined) com.ionicframework.demo340203: 40784

As well as

ionic $ 0 176825 log deviceready has not fired after 5 seconds. 1 176828 log Channel not fired: onCordovaInfoReady.

On another project I get cordova.define is not a function.

As is, no plugins work on either the emulator or iPhone. However, if I run the app in ionic view, plugins do work.

Other solutions I've found to similar problems such as not having cordova.js in the index file have not helped.

If I use ionic-platform-web-client, I also get the error that Cordova is already defined, even when removing cordova.js from the index file.

Has anyone else dealt with this? Any advice would be greatly appreciated!

1

1 Answers

0
votes

Since the device ready has not fired your plugins might not have loaded sucessfully.

remove the the ng-app attribute from the html/body tag

Start the angular app after the deviceready:

ionic.Platform.ready(function(){
// will execute when device is ready, or immediately if the device is already ready.
var YourAppName = angular.module('YourAppName', []);
 });