我正在研究一个带有离子角和科尔多瓦的项目 我使用最新版本的ionic 3.6.0和cordova 7.0.1 问题是在我的Android 4.4.4上它运行得很好,但我总是在我的android 6.1.0上出现以下错误,原因我不知道:
file://android_asset/www/cordova.js: Line 1223 : deviceready has not fired after 5 seconds
file://android_asset/www/cordova.js: Line 1216 : channel not fired : onPluginsReady
file://android_asset/www/cordova.js: Line 1216 : channel not fired : onCordovaReady
file://android_asset/www/cordova.js: Line 1216 : channel not fired : onDOMContentLoaded
Channel not fired onCordovaReady:1216
file://android_asset/www/vendor.js: Line 1 : ERROR
file://android_asset/www/vendor.js: Line 1 : Ionic Native: deviceready did not fire whithin 5000ms. This can happen when plugins are in an inconsistent state try removing plugins from plugins/ and reinstalling them
www目录内容中的index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<script data-ionic="inject">(function(w){var i=w.Ionic=w.Ionic||{};i.version='3.5.3';i.angular='4.1.3';i.staticDir='build/';})(window);
</script>
<meta charset="UTF-8">
<title>Ionic App</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'" />
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4e8ef7">
<!-- cordova.js required for cordova apps -->
<script src="cordova.js"></script>
<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.error('Error', err));
}
</script>-->
<link href="build/main.css" rel="stylesheet">
</head>
<body>
<!-- Ionic's root component and where the app will load -->
<ion-app></ion-app>
<!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>
<script src="build/vendor.js"></script>
<!-- The bundle js is generated during the build process -->
<script src="build/main.js"></script>
</body>
</html>
请帮忙!
答案 0 :(得分:1)
希望这可以帮到你:
打开项目文件夹,找到插件文件夹并将其删除。然后尝试使用cordova prepare
命令再次安装插件。最后运行你的项目。
答案 1 :(得分:0)
转到以下文件your-app-project / config.xml:
并将loadUrlTimeoutValue的值更改为700000
<platform name="android">
<preference name="loadUrlTimeoutValue" value="700000" />
<allow-intent href="market:*" />
</platform>
如果您没有这些行,只需添加它们即可。
如果这不起作用,我怀疑你在没有等待设备准备好的情况下使用插件。
答案 2 :(得分:0)
似乎最终要解决, 我添加了crosswalk插件,它现在可以正常工作,但是启动非常慢,需要1分钟以上