Error: Device communication timed out

Hey,

I’m new at ionic and trying to start an app, with no success :frowning: By trying the command ionic emulate platform android -l -s -c I’m getting this message:

Error: Unknown platforms: platform.

By usind the command ionic run ios -l -c I’m getting the error message below. Any ideas? THX!

C:\Development\sRestaurant>ionic run android --livereload --consolelogs
Setup Live Reload
Running live reload server: undefined
Watching: 0=www//*, 1=!www/lib//*
Running dev server: http://192.168.178.55:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit

ionic $ Running command: “C:\Program Files\nodejs\node.exe” C:\Development\sRest
aurant\hooks\after_prepare\010_add_platform_class.js C:\Development\sRestaurant
add to body class: platform-android
Running command: cmd "/s /c “C:\Development\sRestaurant\platforms\android\cordov
a\run.bat”"
ANDROID_HOME=C:\Development\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
WARNING : No target specified, deploying to emulator
WARNING : no emulator specified, defaulting to test
Waiting for emulator…
emulator: WARNING: Increasing RAM size to 1GB
emulator: UpdateChecker: skipped version check
Booting up emulator (this may take a while)…B
OOT COMPLETE
C:\Development\sRestaurant\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^

Error: Device communication timed out. Try unplugging & replugging the device.
at null._onTimeout (C:\Development\sRestaurant\platforms\android\cordova\nod
e_modules\q\q.js:1717:25)
at Timer.listOnTimeout (timers.js:92:15)
ERROR running one or more of the platforms: Error: cmd: Command failed with exit
code 1
You may not have the required environment or OS to run this project

About the timeout, its simple to solve.

  1. Go to:
    \platforms\android\cordova\node_modules\q

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

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

  4. Run! You’ll see dependencies being installed. Thats why time was running out! #bug

  5. After all, you can undo the changes.

11 Likes

I spent some time trying to fix this, but just your solution worked. Thanks!