2017-08-06 153 views
2

這是一段時間我正在與離子角和科爾多瓦的項目 我使用最新版本的離子3.6.0和科爾多瓦7.0.1 問題是,在我的安卓4.4.4它完美,但我總是得到下面就我的Android 6.1.0錯誤的原因,我不知道:科爾多瓦離子3 deviceready沒有發射在android 6

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

您就可以在'www'你'index.html'文件夾? – Sampath

+0

@Sampath查看版本的index.html內容 –

回答

1

好像是finaly解決, 我增加了人行橫道插件和現在的工作,但啓動速度很慢,需要1分鐘以上

1

希望這可以幫助你:

打開您的項目文件夾,找到插件文件夾並將其刪除。然後嘗試使用cordova prepare命令再次安裝插件。最後運行你的項目。

+0

感謝您的快速回復,我只是試試它,讓你回來的結果:) –

+0

我嘗試它,但我總是有同樣的問題 這可能是由於我使用的平臺,但我不是這是我的config.xml與平臺 ' ' –

+0

嘗試刪除平臺文件夾也'科多瓦平臺刪除android'。然後再次添加'cordova平臺添加android' – skm

0

轉到以下文件的應用程序內項目/ config.xml中:

和loadUrlTimeoutValue的值改爲70萬

<platform name="android"> <preference name="loadUrlTimeoutValue" value="700000" /> <allow-intent href="market:*" /> </platform>

,如果你不具備這些行只加他們。

如果這不起作用,我懷疑你正在使用插件而無需等待設備準備就緒。

+0

我已經在我的配置文件中,但仍然無法正常工作,我創建了新的並且添加了android平臺,當運行它時,我有同樣的錯誤,這可能是我的Android中的一個錯誤,因爲我在其他Android設備上嘗試了它,也是Android 6,並且它完美地工作 –