I was using Cordova, and I am now migrating to Capacitor
I have followed the instructions, all OK, but when I type ionic cap build android, are showing the error bellow:
[ERROR] Unable to find command: cap build android
ionic cap - Capacitor functionality
These commands integrate with Capacitor, Ionic's new native layer project which provides an alternative to Cordova
for native functionality in your app.
Learn more about Capacitor:
- Main documentation: https://ion.link/capacitor
Usage:
$ ionic cap <command> [<args>] [--help] [--verbose] [--quiet] [--no-interactive] [--no-color] [--confirm] [options]
add ............................. Add a native platform to your Ionic project
copy ............................ Copy web assets to native platforms
open ............................ Open the IDE for a given native platform project
run ............................. (beta) Run an Ionic project on a connected device
sync ............................ Sync (copy + update) an Ionic project
update .......................... Update Capacitor native platforms, install Capacitor/Cordova plugins
you will first need to install Andriod into the app using
STEP 1: ionic cap add then select Andriod OR ionic cap add android
STEP 2: Build your app for the prod using ionic build
STEP 3: Finally use ionic build select Andriod OR ionic build android
Forgot to add Incase if ionic cap does not work replace ionic with npx
“ionic cordova build android”, build and done.
“ionic capacitor build android” need to open android studio to compile!!! Man, the android studio is very bad to my computer… I am not liked this, I think will back to cordova… Android studio I had installed only for the SDK’s