【问题标题】:Angular2 Ionic2 Native error deviceready did not fire within msAngular2 Ionic2 Native 错误 deviceready 没有在 ms 内触发
【发布时间】:2017-01-10 00:57:50
【问题描述】:

Ionic2 本机错误:设备就绪未在 2000 毫秒内触发

这会导致白屏 - 应用启动时!

任何解决方案??

【问题讨论】:

    标签: angular ionic-framework ionic2


    【解决方案1】:

    首先确保您的插件在 package.json 中列出,然后执行以下操作:

    ionic platform rm android

    ionic platform add android

    我还遇到了启动时出现白屏的闪屏插件问题,因此请确保在 config.xml 中设置了配置。例如:

    ... <preference name="ShowSplashScreen" value="true"/> <preference name="SplashShowOnlyFirstTime" value="false"/> <preference name="SplashScreenDelay" value="0"/> <preference name="FadeSplashScreen" value="false"/> <preference name="FadeSplashScreenDuration" value="0"/> <preference name="ShowSplashScreenSpinner" value="false"/> <preference name="AutoHideSplashScreen" value="false"/> <preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/> <preference name="SplashScreen" value="screen"/> ...

    并将其隐藏在 src/app/app.component.ts 准备好的设备上

    ... export class MyApp { constructor(platform: Platform) { platform.ready().then(() => { this.hideSplashScreen(); StatusBar.styleDefault(); }); } hideSplashScreen() { if (Splashscreen) { Splashscreen.hide(); } } }

    【讨论】:

      【解决方案2】:

      你可以做ionic state reset。这将删除所有插件并从 package.json 中的 cordovaPlugins 构建所有内容。确保你在那里拥有一切。这取决于您使用的是ionic plugin 还是cordova plugin。

      此命令可能已被弃用,因为 cordova 现在支持此功能。

      编辑

      您可以使用ionic state save 将所有插件保存到package.json

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-12-27
        • 1970-01-01
        • 2016-12-15
        • 2017-05-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-07-20
        相关资源
        最近更新 更多