Mobile App, iOS only error when leaving/returning to app. Can't find variable cordova


I need help solving an issue on a mobile app that occurs only on iOS, please read below the issue details.

The app works fine until I leave it and then go back to it, sometimes it crashes on the 1st time I go back to it, sometimes on the 2nd time.

The exact steps to reproduce the issue are the following.

1- I open my app, and navigate to a screen where a google map is displayed, location on the map loads fine.

2- Click on a button that opens the google maps app and shows the driving directions from my current location to the location previously displaying on my app’s google map. This also works fine.

3- Click on the top left back arrow “Back to MyApp”, it goes back to my app, everything looks as expected, map still fine with location loaded.

4- Click the button again to load google maps and show the driving directions, this is the 2nd time google maps is loading and it loads great, no issues at all.

5- Click again on the top left back arrow “Back to MyApp”, and the application dies. I get a white screen that reads “There was an error processing your request”, also, using safari web inspector to remote debug the iPhone, I get a message that reads “exception nativeEvalAndFetch : ReferenceError: Can't find variable: cordova; Global Code — Script Element 2:1:127”

Please have a look at the attached images for the error messages I get.

Additional notes:

- I am testing it on an iPhone 7 with iOS 10.

- The app works perfectly fine on Android and the issue can not be reproduced.

Any clue how to solve this issue?




While doing some more debugging, I noticed a new msg on the console log.

Right before I get the 'Can't find variable Cordova' error, for a very short moment of time, I see the following message:

"CLOSE database: 2ebd97de-fe80-etc....."

Closing db with transaction queue lenght: 0

Any help would be appreciated.

Best regards,



Did you manage to solve it?