gpt4 book ai didi

android - Cordova Ionic 3 deviceready 未在 android 6 上启动

转载 作者:行者123 更新时间:2023-11-29 01:08:05 25 4
gpt4 key购买 nike

有一段时间我在用 ionic-angular 和 cordova 做一个项目我使用的是最新版本的 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>

请帮忙!

最佳答案

希望对你有帮助:

打开您的项目文件夹,找到插件文件夹并将其删除。然后尝试使用 cordova prepare 命令再次安装插件。最后运行您的项目。

关于android - Cordova Ionic 3 deviceready 未在 android 6 上启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45528568/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com