Error for ionic run cordova android

Hello,
“ionic serve” works well on my pc
since yesterday I can not run “ionic cordova run android” anymore.
the app does not build on my smartphonne and I get,

> ionic-app-scripts build --target cordova --platform android
[13:13:42]  ionic-app-scripts 3.2.0
[13:13:42]  build dev started ...
[13:13:42]  clean started ...
[13:13:42]  clean finished in 32 ms
[13:13:42]  copy started ...
[13:13:42]  deeplinks started ...
[13:13:42]  deeplinks finished in 90 ms
[13:13:42]  transpile started ...
[13:13:49]  transpile finished in 6.41 s
[13:13:49]  preprocess started ...
[13:13:49]  preprocess finished in 1 ms
[13:13:49]  webpack started ...
[13:13:49]  copy finished in 6.78 s
[13:13:55]  webpack finished in 6.10 s
[13:13:55]  sass started ...
[13:13:56]  sass finished in 1.72 s
[13:13:56]  postprocess started ...
[13:13:56]  postprocess finished in 14 ms
[13:13:56]  lint started ...
[13:13:57]  build dev finished in 14.59 s
no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
[13:14:02]  tslint: C:/Users/ludo/Desktop/appli mobile/restful-auth/src/pages/welcome/welcome.ts, line: 4
            All imports on this line are unused.

       L3:  import { TranslateService } from  '@ngx-translate/core';
       L4:  import { TranslateHttpLoader } from '@ngx-translate/http-loader';
[13:14:02]  tslint: C:/Users/ludo/Desktop/appli mobile/restful-auth/src/app/app.component.ts, line: 22

            Property 'translate' is declared but its value is never read.

      L21:      public menu: MenuController,
      L22:      private translate: TranslateService) {

[13:14:02]  lint finished in 5.04 s
> cordova run android
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Users\ludo\Desktop\appli mobile\restful-auth\node_modules\.bin\cordova.cmd ENOENT
    at _errnoException (util.js:992:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
[ERROR] An error occurred while running subprocess cordova.

        cordova run android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
net.js:704
    throw new TypeError(
    ^

TypeError: Invalid data, chunk must be a string or buffer, not object
    at WriteStream.Socket.write (net.js:704:11)
    at process.<anonymous> (C:\Users\ludo\AppData\Roaming\npm\node_modules\ionic\bin\ionic:9:63)
    at emitTwo (events.js:126:13)
    at process.emit (events.js:214:7)
    at emitPendingUnhandledRejections (internal/process/promises.js:108:22)
    at process._tickCallback (internal/process/next_tick.js:189:7)
```I start again with --verbose

ionic:cli-utils:bootstrap local CLI 4.0.6 found at C:\Users\ludo\node_modules\ionic\package.json +0ms
ionic:cli-utils Terminal info: { tty: true, ci: false } +0ms
ionic:cli-utils CLI global options: { _: [ ‘cordova’, ‘run’, ‘android’ ], help: null, h: null, verbose: true, quiet: null,
interactive: true, color: true, confirm: null, json: null, project: null, ‘–’: [] } +2ms
ionic:cli-utils:lib:project Project type from config: Ionic Angular 3 (ionic-angular) +0ms
ionic:cli-utils Project name: undefined +256ms
ionic:cli Context: { binPath: ‘C:\Users\ludo\node_modules\ionic\bin\ionic’, libPath: ‘C:\Users\ludo\node_modules\ionic’, execPath: ‘C:\Users\ludo\Desktop\appli mobile\restful-auth’, version: ‘4.0.6’ } +0ms
ionic:cli-utils:lib:integrations:cordova:config Using config.xml: C:\Users\ludo\Desktop\appli mobile\restful-auth\config.xml +0ms
ionic:cli-utils:lib:integrations:cordova:config Using config.xml: C:\Users\ludo\Desktop\appli mobile\restful-auth\config.xml +41ms
ionic:cli-utils:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:cli-utils:lib:project:ionic-angular:build Looking for ionic:build npm script. +0ms
ionic:cli-utils:lib:project:ionic-angular:build Found ionic:build, but it is the default. Not running. +1ms

ionic-app-scripts build --target cordova --platform android
[13:15:39] ionic-app-scripts 3.2.0
[13:15:39] build dev started …
[13:15:39] clean started …
[13:15:39] clean finished in 20 ms
[13:15:39] copy started …
[13:15:39] deeplinks started …
[13:15:40] deeplinks finished in 90 ms
[13:15:40] transpile started …
[13:15:46] transpile finished in 6.54 s
[13:15:46] preprocess started …
[13:15:46] preprocess finished in 1 ms
[13:15:46] webpack started …
[13:15:46] copy finished in 6.90 s
[13:15:52] webpack finished in 6.08 s
[13:15:52] sass started …
[13:15:54] sass finished in 1.69 s
[13:15:54] postprocess started …
[13:15:54] postprocess finished in 13 ms
[13:15:54] lint started …
[13:15:54] build dev finished in 14.67 s
no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.
[13:15:59] tslint: C:/Users/ludo/Desktop/appli mobile/restful-auth/src/pages/welcome/welcome.ts, line: 4
All imports on this line are unused.

   L3:  import { TranslateService } from  '@ngx-translate/core';
   L4:  import { TranslateHttpLoader } from '@ngx-translate/http-loader';

[13:15:59] tslint: C:/Users/ludo/Desktop/appli mobile/restful-auth/src/app/app.component.ts, line: 22

        Property 'translate' is declared but its value is never read.

  L21:      public menu: MenuController,
  L22:      private translate: TranslateService) {

[13:15:59] lint finished in 5.25 s
ionic:cli-utils:lib:hooks Looking for ionic:build:after npm script. +23s

cordova run android --verbose
events.js:183
throw er; // Unhandled ‘error’ event
^

Error: spawn C:\Users\ludo\Desktop\appli mobile\restful-auth\node_modules.bin\cordova.cmd ENOENT
at _errnoException (util.js:992:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
[ERROR] An error occurred while running subprocess cordova.

    cordova run android --verbose exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms
ionic:cli-framework:utils:process onBeforeExit handler: running 3 queued functions +1ms
ionic:cli-framework:utils:process error while killing process tree for 248: { Error: Command failed: taskkill /pid 248 /T /F Erreur�: le processus “248” est introuvable. at ChildProcess.exithandler (child_process.js:275:12) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) killed: false, code: 128, signal: null, cmd: ‘taskkill /pid 248 /T /F’ } +205ms
net.js:704
throw new TypeError(
^

TypeError: Invalid data, chunk must be a string or buffer, not object
at WriteStream.Socket.write (net.js:704:11)
at process. (C:\Users\ludo\AppData\Roaming\npm\node_modules\ionic\bin\ionic:9:63)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emitPendingUnhandledRejections (internal/process/promises.js:108:22)
at process._tickCallback (internal/process/next_tick.js:189:7)


after all that my app still do not want to work on my smartphonne.

Thank you for your help.

ludo

Many things are here to consider… I have some questions for you.

  • Installed any Update for Ionic ?
  • Installed any Windows/AntiVirus/etc… update ?
  • Did you installed a new plugin ?
  • Did you ran any other Ionic-App on your Phone wich you builded ?
  • Is your Firewall/AntiVirus blocking something ?

It looks like a permission problem to me. Answer me those questions please so we can strike out solutions and find the right answer. :blush:

Hello.
I have been working on the same project for 3 weeks.
The last I had already transferred to my smartphonne to test and everything worked normally.
The only thing I changed in the meantime is that I added translation and globalization to my project.
Can I have to remove the app from my smartphone?
You speak to me about the antivirus, can be that of my smartphonne who blocks because of the “local id”

re.
j’ai trouvé la solution sur cette page

juste a faire npm install -g cordova.

merci encore :slightly_smiling_face:

1 Like