【问题标题】:Ionic : first loading of my android application is abnormally slow离子:我的 android 应用程序的第一次加载异常缓慢
【发布时间】:2017-08-23 17:19:57
【问题描述】:

我的android应用第一次加载异常慢,如果有人遇到过这个问题,我已经尝试删除所有插件重新安装,并删除android平台重新创建,加载时间没有改变,这里是应用程序显示给我的消息

  • Angular 2 正在开发模式下运行。调用 enableProdMode() 启用生产模式。
  • main.js:115328 离子存储驱动程序:cordovaSQLiteDriver
  • plugins/cordova-sqlite-storage/www/SQLitePlugin.js:175 打开数据库:_ionicstorage
  • plugins/cordova-sqlite-storage/www/SQLitePlugin.js:106 新事务正在等待打开操作
  • plugins/cordova-sqlite-storage/www/SQLitePlugin.js:179 打开数据库:_ionicstorage - OK
  • plugins/cordova-sqlite-storage/www/SQLitePlugin.js:80 DB 打开:_ionicstorage
  • cordova.js:1223 deviceready 5 秒后未触发​​。
  • main.js:7881 Native:deviceready 在 2000 毫秒内未触发。当插件处于不一致状态时,可能会发生这种情况。尝试从 plugins/ 中删除插件并重新安装它们。 - main.js:7876 设备在 14273 毫秒后准备就绪

这是我的插件列表

  • Com.googlemaps.ios 2.1.1“适用于 iOS 的 Google 地图 SDK”
  • Com.synconset.imagepicker 2.1.7 "ImagePicker"
  • Cordova-plugin-compat 1.1.0“兼容”
  • Cordova-plugin-console 1.0.5“控制台”
  • Cordova-plugin-crosswalk-webview 2.1.0“Crosswalk WebView 引擎”
  • Cordova-plugin-device 1.1.4“设备”
  • Cordova-plugin-file 4.3.2“文件”
  • Cordova-plugin-file-transfer 1.6.2“文件传输”
  • Cordova-plugin-filepath 1.0.2“文件路径”
  • Cordova-plugin-geolocation 2.4.1“地理位置”
  • Cordova-plugin-googlemaps 1.4.0 “phonegap-googlemaps-plugin”
  • Cordova-plugin-mauron85-background-geolocation 2.2.5 "CDVBackgroundGeolocation"
  • Cordova-plugin-network-information 1.3.1 “网络信息”
  • Cordova-plugin-splashscreen 4.0.1“启动画面”
  • Cordova-plugin-statusbar 2.2.1“状态栏”
  • Cordova-plugin-whitelist 1.3.1“白名单”
  • Cordova-sqlite-storage 2.0.0 “Cordova s​​qlite 存储插件”
  • Ionic-plugin-keyboard 2.2.1“键盘”
  • Onesignal-cordova-plugin 2.0.10“OneSignal 推送通知”

系统信息:

  • 科尔多瓦 CLI:6.5.0
  • Ionic 框架版本:2.0.0-rc.4
  • Ionic CLI 版本:2.1.17
  • Ionic 应用程序库版本:2.1.7
  • Ionic 应用脚本版本:0.0.47
  • ios-deploy 版本:1.9.0
  • ios-sim 版本:5.0.8
  • 操作系统:macOS Sierra
  • 节点版本:v7.2.1
  • Xcode 版本:Xcode 8.2 Build 8C38 版

【问题讨论】:

  • 你做了什么让系统向你显示这些消息?

标签: android cordova ionic-framework loading


【解决方案1】:

我找到了解决办法,你必须把这行代码放在应用程序的 main.ts 中

import {enableProdMode} from '@angular/core';
enableProdMode();

以及构建应用时的标志 --prod

ionic build android --prod

现在我的设备在 2415 毫秒后准备就绪

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-12
    • 2013-03-23
    • 1970-01-01
    • 2011-01-14
    • 1970-01-01
    • 2021-05-25
    • 2021-07-03
    • 1970-01-01
    相关资源
    最近更新 更多