After update Cordova to v6.4.0 and Android platform to 6.0.0, my app don't work any more. I'm getting this:
deviceready has not fired after 5 seconds. cordova.js:1223
Channel not fired: onCordovaInfoReady cordova.js:1216
Channel not fired: onCordovaConnectionReady cordova.js:1216
I tried to remove all plugins and add it one by one. I found that is a problem with cordova-plugin-device and cordova-plugin-network-information. All my plugins are up to date
This should be fixed in cordova-android 6.1.0. It has not been added to the npm-registry yet, so you can use it by placing this to your config.xml:
<engine name="android" spec="https://github.com/apache/cordova-android.git#6.1.0"/>
I recently encountered this same issue on iOS. Eventually what worked for me was a simple
remove
andadd
of theios
platform:It had been quite a while since I had completely re-built the
ios
platform and, just like you, I had made other major changes during that time (Cordova upgrade, XCode upgrade, etc). My theory is that myconfig.xml
or existingios
build was somehow incompliant with the latest Cordova requirements. Doing aplatform remove
andplatform add
will clear out the build files and updateconfig.xml
.I doubt this applies to the OP, but for others who've encountered this same issue, please ensure that you've included
cordova.js
in yourindex.html
file. If you've not done so, add this line:It's a very common omission when just getting started with Cordova.
For someeone (like me) who would not like to downgrade Cordova, please follow my guide (I successfully did after a whole day trying):
Open cordova CLI from root:
cordova platform remove android
After removing:
cordova platform add android
. Your package project (structure) folders are kept, so don't worry.cordova plugin ls
and then remove every cordova plugin execpt Notfication and Whitelist (Cordova's default installed plugins).cordova plugin add <plugin-id>
to add back your using plugins one by one.Go back to you backup-ed folder: Clone back
AndroidManifest.xml
and everything inapp/src/main
. This includes: assets, java, libs and res. One file you only need (actually I suggest) to leave out is res/xml/config.xml. Do not clone this. Let Cordova build later.Cordova CLI (from root cordova project, not platforms/android):
cordova build android
app/src/main/res/xml/config.xml
. Cordova won't be able to detect your 3rd pluginMake sure you included cordova.js on the bottom of the body of your index.html
And don't ever forget about the
type="text/javascript"
that must be located beforesrc=""
Also include this meta tags on the html head
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Then remove the current installed platform and then add it again
Serve it then refresh your browser or build it
If that doesn't solve your problem, then try remove some plugin one by one or remove your scripts to find out the bugs..
I'm running Visual Studio and have this error in the Chrome emulator. I found that firing up the Web Inspector would allow Visual Studio to prompt for some of the hooks that various plugins were asking for, and clicking through the various popups got me past this. It must be something to do with the way that Visual Studio sets up the Cordova Plugin Simulation, but with my setup it was getting blocked from presenting the popups.
If you happen to be running the Crosswalk plugin in your app I just confirmed that uninstalling it and reinstalling via;
cordova plugin add https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview
Gets rid of
deviceready has not fired after 5 seconds. cordova.js:1223 Channel not fired: onCordovaInfoReady cordova.js:1216 Channel not fired: onCordovaConnectionReady cordova.js:1216
You can see the issue at Crosswalk's Jira issue listing here.
https://crosswalk-project.org/jira/browse/XWALK-7422