Android Studio: Cannot run program "node" - android

I have project in React Native, and I'm not being able to build on the Android Studio due the following error.
Here's the detailed log with additional info:
java.io.IOException: Cannot run program "node" (in directory "/Users/fabioernanni/git/fintech-ewallet-mobile/android"): error=2, No such file or directory
java.io.IOException: error=2, No such file or directory
Cause: error=2, No such file or directory
I have tried to reinstall Node, Android Studio, to link the tscript library so the Android Studio would recognize the "node" but nothing seems to help.

I have a similar problem with Android Studio (bumble bee) version with node on My Mac M1 Chip 
so to solve this open your Android Studio from terminal
.
To Open Android Studio from terminal on Mac m1 just open your Terminal and paste the following command
open -a /Applications/Android\ Studio.app
this will open your android studio and then you can open your project and can run build from android studio
Note : be sure that Android studio is not running state if its running just Quite it and then launch from Terminal

Do these steps to solve it:-
STEP 1: First quit the android studio, if it is in a running state.
command + Q
STEP 2: Enable the permission for android studio printenv.
sudo chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
STEP 3: Open android studio from terminal app.
open -a /Applications/Android\ Studio.app

Related

Can't able to run react native application on android device

Im Using MacBook Pro.. Im New To React Native.. After Creating An Project Im Running On iOS Device It's Running.. At The Same Time While I'm Running On Android Device Means Im Getting This Error.. Any One Please Help Me To Resolve This Error.. Im Using Visual Studio Code IDE For React Native Application
Thanks In Advance..
Error Details :
[Info] local.properties file doesn't exist. Using Android SDK location from PATH.
[Info] Starting React Native Packager.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
/bin/sh: adb: command not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* Where:
Settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'
* What went wrong:
Could not compile settings file '/Users/manikandan/AwesomeProject/android/settings.gradle'.
startup failed:
General error during semantic analysis: Unsupported class file major version 57
So you have two errors to fix here as your error log
local.properties file doesn't exist.
Failed to launch the emulator
local.properties file issue fixing
Open your react native project android folder using Android Studio.
Wait for gradle sync and clean the project and rebuild it using Android Studio
After that make sure you have local.properties file is been created inside android folder
If not try these steps to make local.properties file manually
Right click top level of project and Create new file 'local.properties' then add: sdk.dir=/Users/<YourUsername>/Library/Android/sdk
Clean and build
Before running your react native project on android make sure you have turn on the Android Emulator by AVD Manager in Android Studio
If you have not create any emulators then try this link - I have posted full answer on how to make Android Emulator -
React native failed to launch emulator
EDIT :
For adb error you need to install adb drivers on you Mac
Follow these steps
First install Homebrew using this command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
or this command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that install adb using homebrew
brew cask install android-platform-tools
Try to re run

studio.sh is not working on ubuntu 17.04

i have a problem in running ./studio.sh and when I try to run it by terminal , this error shows in the picture attached
click to see image
You need to to into the directory where your studio.sh file exists as below :
/opt/android-studio/bin/studio.sh
I am using path to android studio in my system, You need to your system's path to android studio, where your android studio is located.

vscode use react native tools run react native project , but adb devices /bin/sh: adb: command not found

I use vscode extension run react native project
but console
[Error : 0101] Failed to run the application in Android: Error while executing command 'adb devices': Command failed: adb devices /bin/sh: adb: command not found
I use terminal use react-native run-android , it can run , i write the config in .bash_profile and .zshrc file , how to solve it ?
I always meet with situation but after research I found a solution as below
But make sure your have to restart your MAC OS

Android studio ide install error on Mac Yosemite

When I downloaded android-studio-ide-141.2135290-mac and tried installing it on my Mac Yosemite, I faced errors such as:
file not found
the following SDK components were not installed: platfrom tools,extra-android-m2erepository and extra-google-m2erepository
In OS X run as admin the first time by opening a new Terminal and run the commands:
cd /Applications/Android\ Studio.app/Contents/MacOS/
sudo ./studio

]Unable to launch Android Studio in Ubuntu 14

I enter this command in terminal first I change the directory to terminal and then when I try to open the studio.sh It gives bash error
sarthak#sarthak:~/development$ /android-sdk/bin/studio.sh
bash: /android-sdk/bin/studio.sh: No such file or directory
sarthak#sarthak:~/development$
Please Help
Because the script file is in bin directory you need to go there to run it.
Go to the bin directory in terminal by doing:
cd ../../bin
And then run the script by doing:
./studio.sh
You can install it from the repository here
Android studio paolorotolo repository
launch it first time from studio.sh in bin directory like this:
cd opt/android-studio/bin/
./studio.sh
this will launch android studio.
And from android stuio tools tab -> genereate desktop entry to see it in search and programs.

Categories

Resources