离子2设备准备好在2000ms内没有开火

mah*_*ail 15 cordova ionic-framework ionic2 ionic3

我在工作中ionic 2 beta 11IOS平台上运行使用的应用程序后ionic run ioswhite screen出现,得到了以下信息:

Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?究竟是什么问题?

seb*_*ras 10

这可能是由于几个问题而发生的,所以你必须尝试一些事情:

  1. 通过运行重新安装平台 ionic state reset --platform
  2. ionic state reset --plugins在执行此操作之前,请先运行重新安装插件,请检查package.json文件中是否包含所有插件.
  3. 就像@joshmorony 在这里说的那样,尝试改变Content-Security-Policyindex.html的这个:

    <meta http-equiv="Content-Security-Policy" content="default-src gap://ready file://* *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *”>
    
    Run Code Online (Sandbox Code Playgroud)

  • 根据这两个主题:https://github.com/driftyco/ionic-cli/issues/904和https://github.com/driftyco/ionic-cli/issues/1324,不推荐使用`state` commads.相反,虽然添加平台和插件`--save`用于将相同的内容添加到`config.xml`.要重置插件和平台,请删除相应的文件夹并发出`ionic prepare` (4认同)
  • `离子状态重置--plugins`快速解决了我的问题,谢谢 (2认同)

Mic*_*gue 6

正如另一个答案的评论中所提到的,在新版本的CLI中,您应该手动删除pluginsplatforms文件夹.然后运行:

ionic cordova prepare
Run Code Online (Sandbox Code Playgroud)