【问题标题】:Ionic 3 CordovaError: Device communication timed out. Try unplugging & replugging the deviceIonic 3 CordovaError:设备通信超时。尝试拔下并重新插入设备
【发布时间】:2018-11-16 01:29:12
【问题描述】:

我最近收到此错误。我不知道为什么会这样。过去一切正常,现在没有明显的原因,该应用程序将不再部署在设备上。 我已经尝试过这篇文章中的解决方案,但仍然没有运气。

Ionic run error exit code 1 device communication timed out

每次运行 ionic cordova run android 命令时都会出现错误。

BUILD SUCCESSFUL in 3s
47 actionable tasks: 1 executed, 46 up-to-date

Built the following apk(s):

C:\wamp64\www\afghanjam\platforms\android\app\build\outputs\apk\debug\app- 
debug.apk

 ANDROID_HOME=C:\Users\Hamid\AppData\Local\Android\sdk
 JAVA_HOME=C:\Program Files\java\jdk1.8.0_102
 No target specified, deploying to device 'LGH81539ab6482'.

 **(node:8400) UnhandledPromiseRejectionWarning: Unhandled promise rejection 
 (rejection id: 1): CordovaError: Device communication timed out. Try 
 unplugging & replugging the device.**

 (node:8400) [DEP0018] DeprecationWarning: Unhandled promise rejections are 
 deprecated. In the future, promise rejections that are not handled will 
 terminate the Node.js process with a non-zero exit code.

 [OK] Your app has been deployed.
 Did you know you can live-reload changes from your app with --livereload?

我尝试删除 android 并将其从平台列表中重新添加。 还尝试从计算机上卸载手机并从设备管理器重新安装以更新驱动程序,但仍然没有运气。

【问题讨论】:

  • 你解决了吗?

标签: cordova ionic-framework ionic3


【解决方案1】:

我发现了一个棘手的解决方法:

  1. 转至:\platforms\android\cordova\node_modules\q

  2. 定位:

    var timeoutId = setTimeout(function () {deferred.reject(new
    Error(message || “Timed out after " + ms + " ms”)); }, ms);
    
  3. 改为:

    var timeoutId = setTimeout(function () {
    deferred.reject(new Error(message || “Timed out after " + ms + "
    ms”)); }, 600000); //10 minutes before timing out
    

【讨论】:

    【解决方案2】:

    我遇到了一个非常相似的问题,有时会记录此设备错误,有时会记录 cordova 插件问题或 jdk 未正确安装错误。

    我所说的错误:

    设备通信超时。尝试 拔下并重新插入设备。**"

    执行程序失败,退出代码为 3221225794。

    我通过运行以下命令成功修复了它,该命令修复了 Windows 上的所有 DLL 问题,然后重新启动计算机。 在 powershell 中,可能需要管理员:

    sfc /scannow
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-16
      • 1970-01-01
      • 2019-03-08
      相关资源
      最近更新 更多