Capacitor v7 - errors after following instructions on website - unable to build apk

On OSX 14.4

I have a fresh install of Capacitor v7
Ran through the installation process and updated where appliccable.

Ran:
npx cap build android

Received the following:

Running Gradle build in 952.91ms
[error] Missing options. Please supply all options for android signing. (Keystore Path, Keystore Password,
Keystore Key Alias, Keystore Key Password)

I am at a loss as to why this was missing when I followed the setup and installation processes from the site.

The capacitor.config.json file is

{
“appId”: “com.somecompany.app”,
“appName”: “Somecompany App”,
“webDir”: “dist”
}

I have a few red folders in the following from the root of my project

/android
/android/app
/android/capacitor-cordova-android-plugins
/node_modules

And while installing capacitor v7 the following warnings came up:

Run:
npm i -D @capacitor/cli

Will throw:

npm i -D @capacitor/cli
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘rimraf@6.0.1’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘glob@11.0.1’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘jackspeak@4.1.0’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘minimatch@10.0.1’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘path-scurry@2.0.0’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘lru-cache@11.0.2’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }

added 98 packages, changed 1 package, and audited 394 packages in 4s

41 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Also ran the following and got errors that according to this:

were resolved… but are not

npm i @capacitor/android @capacitor/ios
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘glob@11.0.1’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘minimatch@10.0.1’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘rimraf@6.0.1’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘jackspeak@4.1.0’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘path-scurry@2.0.0’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: ‘lru-cache@11.0.2’,
npm WARN EBADENGINE required: { node: ‘20 || >=22’ },
npm WARN EBADENGINE current: { node: ‘v21.6.1’, npm: ‘10.2.4’ }
npm WARN EBADENGINE }

added 2 packages, and audited 396 packages in 1s

41 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

Lastly:

I found the following command to get this missing option parameter which is:

keytool -list -v -keystore /Users/yourusernamehere/.android/debug.keystore
-alias androiddebugkey -storepass android -keypass android

This did not work either when running: npx cap build android ( I did change the username to the valid one on my build machine )

And the following error persists:

Missing options. Please supply all options for android signing. (Keystore Path, Keystore Password,
Keystore Key Alias, Keystore Key Password)

What exactly is missing?

The docs are not complete, npx cap build android will build a signed apk/aab, but for doing a signed build you’ll need to provide the keystore path, keystore password, keystore alias and keystore alias password, that’s missing on the docs. You can pass those values as parameters or have then included in your capacitor config file.
If you want to do a debug build you’ll have to use Android Studio as instructed a few lines earlier

After sync, you are encouraged to open your target platform’s IDE: Xcode for iOS or Android Studio for Android, for compiling your native app.

1 Like

I somehow stumbled across a working solution as you said, the docs are not complete.

Running:
keytool -list -v -keystore /Users/youruseraccount/.android/debug.keystore
-alias androiddebugkey -storepass android -keypass android

And pressing enter for the password was the last missing piece for v7

Now I am able to get this working somewhat using the iconic dashboard plugin using visual code studio and copying my apk to a connected android device.

Hoping that the process and documentation gets better as I don’t recall having such a hard time with v4 when I first used Capacitor.

the npx cap build android command was added in Capacitor 4.4.0, and the docs to mention the npx cap build android command were updated last summer, so you most likely didn’t run into that “issue” back then it was because you didn’t run the command.

I also did not use the built in plugin but was running via CLI exclusively. I most likely did not see what you mentioned above from last year and now either.

In anycase, I’ve stumbled across how to get it working after getting around the above mentioned hiccups, but following along with the instructions left much to be desired.

Now to figure out how to get brotli compressed files to work within a Capacitor app.