【问题标题】:IONIC 3 [ERROR] An error occurred while running cordova run android (exit code 1)IONIC 3 [ERROR] 运行 cordova run android 时发生错误(退出代码 1)
【发布时间】:2017-11-09 20:29:47
【问题描述】:

我从 ionic 3 开始,但我尝试运行命令“ionic cordova run android”,我尝试了任何方法来解决这个问题,但我无法从这个问题中找到答案,我得到了这样的错误:

this result error
[13:29:45]  preprocess started ...
[13:29:45]  deeplinks started ...
[13:29:45]  deeplinks finished in 44 ms
[13:29:45]  preprocess finished in 52 ms
[13:29:45]  webpack started ...
[13:29:45]  copy finished in 14.20 s
[13:30:30]  webpack finished in 45.55 s
[13:30:30]  sass started ...
[13:30:36]  sass finished in 5.48 s
[13:30:36]  postprocess started ...
[13:30:36]  postprocess finished in 22 ms
[13:30:36]  lint started ...
[13:30:36]  build dev finished in 64.67 s
[13:30:36]  watch ready in 65.09 s
[13:30:36]  dev server running: http://localhost:8100/

> cordova run android
[13:30:46]  lint finished in 10.69 s
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_112
Error: Cannot read property 'length' of undefined


[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova run android (exit code 1).

这是我的离子信息:

全局包:

@ionic/cli-plugin-proxy : 1.3.0
@ionic/cli-utils        : 1.3.0
Cordova CLI             : 7.0.1
Ionic CLI               : 3.3.0

本地包:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms               : android 6.2.3
Ionic Framework                 : ionic-angular 3.3.0

系统:

Node       : v6.11.0
OS         : Windows 7
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

【问题讨论】:

  • 错误是什么?
  • ionic cordova run android -> 错误:无法读取未定义的属性“长度”[错误] Cordova 遇到错误。您可以通过直接运行上面的 Cordova 命令获得更多信息。 [ERROR] 运行 cordova run android 时出错(退出代码 1)。
  • 尝试运行cordova run android 命令..
  • 我尝试了该命令,但结果没有改变,结果仍然错误
  • cordova requirements 给了什么?

标签: android angular cordova ionic3


【解决方案1】:

我也遇到了同样的问题, [ERROR] 运行 cordova run android 时出错(退出代码 1)。

在 CLI 中使用以下命令:

ionic cordova platform rm android
ionic cordova platform add android
npm cache clear
ionic cordova run android 

还在 android studio 中更新或创建新的 AVD。

【讨论】:

    猜你喜欢
    • 2018-01-15
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多