Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exception nativeEvalAndFetch: ReferenceError: Can't find variable: cordova

I keep getting an error with Angular and Ionic, running on iOS simulator.

When running

ionic run ios

It was launching on the simulator fine. Then I pressed the home button on the simulator and got

exception nativeEvalAndFetch : ReferenceError: Can't find variable: cordova

I was testing for deeplinking on my ionic app and this broke it.

like image 856
Chris Hume Avatar asked Jan 05 '16 17:01

Chris Hume


1 Answers

In order to fix, I put

<script src="cordova.js"></script>

In my header. I had

<script src="phonegap.js"></script>

So now I have both in the header and it is working fine. Not sure if I need both or not, but it works.

Also, my phonegap.js lives in my app folder. So I add to the gruntfile so it will copy over when I grunt build.

like image 161
Chris Hume Avatar answered Nov 17 '22 17:11

Chris Hume