无法在模拟器上运行离子应用

时间:2018-07-02 10:33:53

标签: android node.js ionic3

我正在尝试在android模拟器上运行离子应用程序,但是我一直收到此错误。

    ANDROID_HOME=C:\Users\Dell\AppData\Local\Android\sdk
    JAVA_HOME=C:\Program Files\Java\jdk1.8.0_171
    (node:14376) UnhandledPromiseRejectionWarning: Error: C:\Users\Dell\AppData\Local\Android\sdk\platform-tools\adb.exe: Command failed with exit code 1 Error output:
adb server version (39) doesn't match this client (40); killing...
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
    at ChildProcess.whenDone (C:\Users\Dell\Desktop\ionicsidemenu\ionic2-sidemenu-highlight\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:14376) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14376) [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.

1 个答案:

答案 0 :(得分:0)

对于这种不一致的情况,可能的解决方案如下:

  1. 在Android平台下的config.xml中添加此首选项:
  

<preference name="loadUrlTimeoutValue" value="700000" />

  1. 在每次启动之前杀死并重新启动adb服务器
  

adb kill-server adb forward --remove-all adb start-server

  1. 尝试创建一个新的AVD,并在启动该AVD时将其作为目标 AVD删除并重新添加android平台并重建相同的
相关问题