An error occurred while running subprocess capacitor when creating new Ionic project
Asked Answered
P

1

5

I was working with Ionic Framework using AngularJs. Every Thing was fine. However now, When I am trying to create now Ionic/Angular js Project, I am facing a problem with the capacitor, as following:

enter image description here

enter image description here

How to solve this problem? I could not found a solution from any of the previous posts.

Plascencia answered 21/5, 2021 at 8:41 Comment(0)
I
30

Capacitor 3 was released 2 days ago, and your ionic cli version is not compatible with it, you need to update the ionic cli version

npm uninstall -g ionic
npm uninstall -g @ionic/cli
npm install -g @ionic/cli

the first one is only needed if you were using the old ionic CLI, it was renamed to @ionic/cli long ago, but some people is still using it because they didn't know, so I put it here just in case

Isobath answered 21/5, 2021 at 12:31 Comment(5)
Still, when I am trying to build the app, I am getting the same error: [ERROR] An error occurred while running subprocess capacitor. capacitor.cmd run android --no-sync --target Pixel_3_API_29 exited with exit code 1.Plascencia
answer was the key. looks that the new version of the capacitor has a lot of changes. Even I re-installed android studio to solve the problems that emerged after the updation.Plascencia
It definitely was a hoop to jump through, then afterwards it complained about deleting the capacitor.config.ts. That was it, from there adding Android was not a problem.Biopsy
This worked liked a charm, in addition I added ionic integrations enable capacitor at the end - thanksShir
This solution works with Ionic v7, thanks Additionally remember to build the project before(ng build) to generate the www directory.Leverick

© 2022 - 2024 — McMap. All rights reserved.