Run the same command with --verbose, maybe there is more output.
Run the same command without ionic in front, maybe also with --verbose, to maybe get more output.
Running ionic cordova build ios --verbose gives me this right off the bat and quits
[DEBUG] Checking for latest plugin version of ionic@latest.
"3.0.0"
[DEBUG] Latest version of ionic@latest is .
[DEBUG] !!! ERROR ENCOUNTERED !!!
SyntaxError: Unexpected end of JSON input
[DEBUG] SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at /usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/dist/lib/plugins.js:212:36
at next (native)
at fulfilled (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/dist/lib/plugins.js:4:58)
Without ionic it completes just fine, same goes for without --verbose.
Normally it is caused by missing CLI Plugins… but you seem to have them installed. Sometimes it is an invalid ionic.config.json file, discussed here: https://github.com/driftyco/ionic-cli/issues/2275
Can you try the current alpha of the next CLI version? npm i -g ionic@canary to install. Then we know if this will be solved better with CLI 3.1.
That worked, but it still fails after the build has succeeded
** BUILD SUCCEEDED **
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[DEBUG] !!! ERROR ENCOUNTERED !!!
[ERROR] An error occurred while running cordova build ios (exit code 1).
I suppose I’ll just live with it, if you don’t have a clue haha
That’s what I did, I’ll paste majority of the output:
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for @ionic/cli-plugin-proxy
[DEBUG] Load local plugin @ionic/cli-plugin-cordova from /Users/Michael/Workspaces/brokerApp/node_modules/@ionic/cli-plugin-cordova
[DEBUG] Load local plugin @ionic/cli-plugin-ionic-angular from /Users/Michael/Workspaces/brokerApp/node_modules/@ionic/cli-plugin-ionic-angular
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser
[10:27:22] build dev started ...
[10:27:22] clean started ...
[10:27:22] clean finished in 2 ms
[10:27:22] copy started ...
[10:27:22] transpile started ...
[10:27:26] transpile finished in 4.58 s
[10:27:26] preprocess started ...
[10:27:26] deeplinks started ...
[10:27:26] deeplinks finished in 172 ms
[10:27:26] preprocess finished in 173 ms
[10:27:26] webpack started ...
[10:27:27] copy finished in 4.94 s
[10:27:42] webpack finished in 16.02 s
[10:27:42] sass started ...
[10:27:44] sass finished in 1.71 s
[10:27:44] postprocess started ...
[10:27:44] postprocess finished in 12 ms
[10:27:44] lint started ...
[10:27:44] build dev finished in 22.55 s
> cordova build ios
--- snip, no errors but I can paste all of it if you want, seems irrelevant since it happens for android too :) ---
** BUILD SUCCEEDED **
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[DEBUG] !!! ERROR ENCOUNTERED !!!
[ERROR] An error occurred while running cordova build ios (exit code 1).
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for @ionic/cli-plugin-proxy
Could you create a ticket at https://github.com/driftyco/ionic-cli/issues please? Someone from CLI should look at it, probably more people will turn up with problems like this when CLI v3 gets more and more installs. Include a link to this thread and all the relevant output you already posted here (and maybe the package.json). Thanks.
Was in the middle of doing it, then realized I suck at reading. When it throws “PLUGIN_NOT_INSTALLED”, it was apparently for the global install of @ionic/cli-plugin-proxy.
[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for @ionic/cli-plugin-proxy
[DEBUG] Load local plugin @ionic/cli-plugin-proxy from /Users/Mic...
I ran
npm install @ionic/cli-plugin-proxy -g
and it went away, though it still exited with code 1. I assumed it wasn’t really necessary to have it globally, and that this was unrelated to the exit code thing. So I decided to remove my platforms and plugins and re-install it all, and now the exit code thing has gone away. So the CLI wasn’t to blame for that after all, but now I have no idea what caused it…
That’s the frustrating thing with these Ionic CLI v3 problems popping up right now: They are there and then they aren’t. Right now I can’t distinguish the real ones by the ones fixed by just reinstalling