简体   繁体   中英

Unable to run ionic app on emulator

i am trying to run ionic app on android emulator but i keep getting this error .

    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.

The possible solutions for this inconsistent scenario is as follows:

  1. Add this preference in you config.xml under android platform:

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

  1. Kill and restart adb server before every launch

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

  1. Try creating a new AVD and mention it as target while launching the AVD Remove and re-add android platform and rebuild the same

run this command
taskkill /f /im adb.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM