Search code examples
androidlinuxandroid-studioionic-frameworkcapacitor

android studio crashing on linux after being launched from npx


When I type: npx cap open android

I get the following error:

[info] Opening Android project at: android.
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: spawn /home/dan/android-studio EACCES
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -13,
  code: 'EACCES',
  syscall: 'spawn /home/dan/android-studio',
  path: '/home/dan/android-studio',
  spawnargs: [ '/home/dan/dev/project/android' ]
}

I have checked permissions, tried SUDO and tried setting/unsetting the usual environment variables. I think this might be causing other issues.

I am running linux mint


Solution

  • You have to point to the actual android studio executable file (.sh file), not to the folder where Android Studio is