I am trying to add android as a supported platform to my project by running the command: ionic capacitor add android.
The command is executed and stops at a prompt which asks me "which npm client would you like to use ? (use arrow keys), with yarn being the only option.
The problem is I am stuck at this point and pressing the arrow keys do not register anything (the keys work fine) and I cant even select the only option I am given
So far I have tried: uninstalling yarn creating new project deleting the node_modules updating all modules
Nothing seems to work. On the plus side though when I attempted to do these steps on another machine it all worked well and I never got the prompt, which makes it unique to only my main workstation. I am still trying to figure out why I get the problem on this specific machine
It's a bug on the ionic CLI. It's been fixed, but not released yet. https://github.com/ionic-team/capacitor/issues/1453
As workaround you can remove the --capacitor
option when creating the project, and then do the integration manually like this:
npm install @capacitor/core @capacitor/cli
npx cap init
And let Ionic know you did the integration by adding this to the ionic.config.json
"integrations": {
"capacitor": {}
},
I got this issue while adding the android platform in the Ionic Capacitor app using the below command.
$ ionic capacitor add android
It seems a bug in Ionic CLI (as mentioned above). So, I thought to use Capacitor CLI instead.
As a workaround, I did the following:
$ npm install @capacitor/android
$ npx capacitor add android
This successfully added the android folder to my project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With