capacitor: bug: @capacitor/android: 3.4.3 - ERR_SUBPROCESS_COMMAND_NOT_FOUND

Bug Report ERR_SUBPROCESS_COMMAND_NOT_FOUND

What command is it looking for? Perhaps the error should specify?

Capacitor Version

% npx cap doctor android 
๐Ÿ’Š   Capacitor Doctor  ๐Ÿ’Š 

Latest Dependencies:

  @capacitor/cli: 3.4.3
  @capacitor/core: 3.4.3
  @capacitor/android: 3.4.3
  @capacitor/ios: 3.4.3

Installed Dependencies:

  @capacitor/cli: 3.4.3
  @capacitor/core: 3.4.3
  @capacitor/android: 3.4.3
  @capacitor/ios: 3.4.3

Platform(s)

@capacitor/android: 3.4.3

Current Behavior

% npx cap run android
โœ” Copying web assets from www to android/app/src/main/assets/public in 9.85ms
โœ” Creating capacitor.config.json in android/app/src/main/assets in 1.07ms
โœ” copy android in 16.39ms
โœ” Updating Android plugins in 1.16ms
[info] Found 3 Capacitor plugins for android:
       @capacitor/camera@1.3.1
       @capacitor/filesystem@1.1.0
       @capacitor/geolocation@1.3.1
โœ” update android in 28.55ms
โœ– Running Gradle build - failed!
[error] ERR_SUBPROCESS_COMMAND_NOT_FOUND

Expected Behavior

Expect the app to run in the emulator

Code Reproduction

https://github.com/codeconsole/exiftest/tree/capacitor

Other Technical Details

npm --version output: 8.5.5

node --version output: v17.8.0

pod --version output (iOS issues only): 1.11.2

Additional Context

% cd android
% ./gradlew assembleDebug 

BUILD SUCCESSFUL in 798ms
153 actionable tasks: 153 up-to-date
% npx ionic info

Ionic:

   Ionic CLI : 6.19.0

Capacitor:

   Capacitor CLI      : 3.4.3
   @capacitor/android : 3.4.3
   @capacitor/core    : 3.4.3
   @capacitor/ios     : 3.4.3

Utility:

   cordova-res : not installed globally
   native-run  : 1.5.0

System:

   NodeJS : v17.8.0 (/opt/homebrew/Cellar/node/17.8.0/bin/node)
   npm    : 8.5.5
   OS     : macOS Monterey
% sw_vers
ProductName:	macOS
ProductVersion:	12.3
BuildVersion:	21E230
% sysctl -a | grep brand    
machdep.cpu.brand_string: Apple M1 Pro

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Should be fixed by a

brew update && brew upgrade libuv

There seems to be some weird bug on the nodejs installed from homebrew (not only 17, Iโ€™ve seen it on 16 and 14 too, 12 worked fine)

Iโ€™ve created a gist with a simplification of the code that is failing, and itโ€™s nodejs spawn behaving differently on the homebrew node installs when running the gradle file, it calls the error function with ENOENT and the close function with -2 code, but the gradle execution finished correctly with

BUILD SUCCESSFUL in 490ms 1 actionable task: 1 executed

When using node from nvm/nodenv it doesnโ€™t call the error function and the close is called with code 0