2

I have been working with Cordova, and in terms of functionalities everything works.

The problem is, I see white screen on some browsers, such as browsers except Safari on Apple mobile devices (so Chrome, Firefox and so on). On Macbook Pro I tested Chrome, Firefox, Safari and they work. Unfortunately I could not debug the Chrome or Firefox on iPad/iPhone, but on IntelXDK, I can emulate some devices, and some of them (Microsoft Surface Pro, Lenovo IdeaPad Yoga 13 Ultrabook, Toshiba Satellite Ultrabook) also show me white screen and here is the error:

deviceready has not fired after 5 seconds. cordova.js:1189
Channel not fired: onCordovaReady cordova.js:1182
Channel not fired: onCordovaInfoReady cordova.js:1182
Channel not fired: onFileSystemPathsReady 

Do you have any idea what the reason can be? I tried many things, changing the version of the Cordova and plugins, made changes in the code where I call event listener for 'deviceready' but nothing worked.

Cordova version is 5.4.1

Thanks!

Eylül
  • 139
  • 1
  • 3
  • 13
  • What you can try is to downgrade your cordova version and test it again. If it doesn't work, create a new fresh project(with the last cordova version) and test it on all devices. If it works, this means you have a plugin that's messing up your initial project. and if it doesn't work, well... I don't know – AshBringer Jan 29 '16 at 17:21
  • you don't have to test the app on browsers, you have to build the app – jcesarmobile Feb 01 '16 at 15:15
  • Well, I was already using an older version of Cordova and I had the same behaviour. For this reason, I upgraded to the latest version (5.4.1), started from a new project, added the last version of plugins and so on. However the issue still remains. Do you know any Cordova version that works? I can downgrade specifically to that version. – Eylül Feb 03 '16 at 17:04
  • @jcesarmobile I am building the project for browser. Copying the content under "platforms/browser" to the server, and try from iPad/iPhone. Isn't this right? – Eylül Feb 03 '16 at 17:06
  • No, that isn't right. You can add browser platform to test on the browser – jcesarmobile Feb 03 '16 at 17:41
  • @jcesarmobile Yes, but the project works as an application on Apple devices. As I listed also before it doesn't work on browsers of Apple mobile devices, except Safari (so Google Chrome, Firefox, Opera,...) So, there is no wide subset here. – Eylül Feb 04 '16 at 09:11
  • I'm telling you that you are doing it wrong, you can't copy the browser files to a server and expect them to work on the ipad, they are the files fro the browser platform and will only work if you run them with `cordova run browser` (it will open chrome), they won't work on a server and they won't work on an iPad/iPhone. Each platform has it's own cordova.js and doesn't work on other platforms. – jcesarmobile Feb 04 '16 at 09:19
  • @jcesarmobile Sorry it is not clear to me. What I do is "cordova build" and then "cordova run browser". This creates the folder for "browser" under platforms directory. So instead of copying this folder to the server, what should I do? Should I install Cordova and do whatever I am doing locally also on the server? Also, isn't browser platform intended for all the browsers, that are on desktop, mobile; Linux, Windows, OS X and so on? – Eylül Feb 04 '16 at 09:47
  • No, browser platform is just for fast testing on a browser, but just testing. It's not intended to be used on a server. – jcesarmobile Feb 04 '16 at 09:54
  • @jcesarmobile Ok, so what should I do, if I want it to work on all the browsers? – Eylül Feb 04 '16 at 10:03
  • cordova code isn't meant to be run on browsers. You create mobile apps and run the code inside your apps, not inside the browser. If you want to build web apps that run on web browsers you don't need cordova. – jcesarmobile Feb 04 '16 at 10:53
  • @jcesarmobile I need both, unfortunately. – Eylül Feb 05 '16 at 13:47

1 Answers1

1

I perused the net and discovered on a forum that someone was having a similar problem. It does appear to be an issue with plugins. Here is a link to the forum I found, and a snippet of what the user found had worked. I am sorry, I am still new to JS and can only use the power of googling! Hope it helps!

Site

Just in case anyone else gets this issue I was able to make cordova plugin file works with Android/IOS emulators. Finally, I'm only having above problem with Cordovasim. Currently I'm using following packages versions:

  • apache plugin org.apache.cordova.file 1.3.3 "File"
  • ngCordova $cordovaFile to use easier the plugin
  • cordova platforms android 3.7.1, ios 3.7.0
Community
  • 1
  • 1