离子cordova构建android卡在闪屏

时间:2018-09-11 15:43:53

标签: android angular cordova ionic-framework

所以我的应用程序可以在网络上正常运行,现在我想构建android apk文件并对其进行测试,所以我可以这样做:

ionic cordova platform add android
ionic cordova build android

这两个之后我没有错误。

然后我去android studio并运行android项目,构建成功。 启动我的应用程序后,我看到离子飞溅屏仅旋转1秒钟,然后他停止了,就这样。卡在启动画面上。

离子信息:

Ionic:

   ionic (Ionic CLI)  : 4.1.1 (C:\Users\Andrejus\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : not available

System:

   NodeJS : v8.11.1 (C:\Program Files\nodejs\node.exe)
   npm    : 5.6.0
   OS     : Windows 10

插件列表:

com.unarin.cordova.beacon 3.7.0 "Proximity Beacon Plugin"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-facebook4 2.3.0 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-ionic 4.2.0 "IonicCordova"
cordova-plugin-ionic-webview 2.1.0 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

在android studio中,我总是收到此错误:

09-11 15:41:11.427 6218-6277/com.port4you.app D/SERVER: Handling local request: http://localhost:8080/assets/icon/favicon.ico
09-11 15:41:11.435 6218-6218/com.port4you.app D/CordovaWebViewImpl: onPageFinished(http://localhost:8080/)
09-11 15:41:11.459 6218-6218/com.port4you.app D/SystemWebChromeClient: http://localhost:8080/build/polyfills.js: Line 3 : Unhandled Promise rejection:
09-11 15:41:11.459 6218-6218/com.port4you.app I/chromium: [INFO:CONSOLE(3)] "Unhandled Promise rejection:", source: http://localhost:8080/build/polyfills.js (3)
09-11 15:41:11.485 1938-2864/system_process E/memtrack: Couldn't load memtrack module
09-11 15:41:11.485 1938-2864/system_process W/android.os.Debug: failed to get memory consumption info: -1
09-11 15:41:15.188 1938-1956/system_process E/memtrack: Couldn't load memtrack module
09-11 15:41:15.188 1938-1956/system_process W/android.os.Debug: failed to get memory consumption info: -1
09-11 15:41:15.201 1938-1956/system_process E/memtrack: Couldn't load memtrack module
09-11 15:41:15.201 1938-1956/system_process W/android.os.Debug: failed to get memory consumption info: -1

此错误每4-5秒:

09-11 15:41:15.201 1938-1956/system_process E/memtrack: Couldn't load memtrack module
09-11 15:41:15.201 1938-1956/system_process W/android.os.Debug: failed to get memory consumption info: -1

运行错误:

D/SERVER: Handling local request: http://localhost:8080/assets/icon/favicon.ico
D/SystemWebChromeClient: http://localhost:8080/build/polyfills.js: Line 3 : Unhandled Promise rejection:
I/chromium: [INFO:CONSOLE(3)] "Unhandled Promise rejection:", source: http://localhost:8080/build/polyfills.js (3)
W/com.unarin.beacon: WARNING did not receive delegate ready callback from DOM after 30 seconds!
D/SystemWebChromeClient: : Line 1 : WARNING did not receive delegate ready callback from DOM after 30 seconds!
I/chromium: [INFO:CONSOLE(1)] "WARNING did not receive delegate ready callback from DOM after 30 seconds!", source:  (1)
D/CordovaActivity: Paused the activity.
W/com.facebook.appevents.AppEventsLogger: deactivateApp events are being logged automatically. There's no need to call deactivateApp, this is safe to remove.
D/EGL_emulation: eglMakeCurrent: 0x7566c1c5dba0: ver 3 1 (tinfo 0x7566d142bde0)
D/CordovaActivity: Stopped the activity.
D/CordovaActivity: CordovaActivity.onDestroy()
W/BeaconManager: This device does not support bluetooth LE.
                 Method invocation will be ignored.
Application terminated.

console.error:

enter image description here

1 个答案:

答案 0 :(得分:0)

打开Chrome并转到chrome:// inspect /#devices

然后检查您的远程设备并检查控制台选项卡。您可能会遇到插件问题。

您也可以使用

ionic cordova run android -c

这样,您可以在命令中检查控制台。