Problem with Android Environment setup in React Native - android

I am running React Native app on MacBook M1 chip, I have already set up the environment like this, but when I type NPM RUN ANDROID, the error kept showing, please help me out, Thanks

Please check path
export ANDROID_HOME="/Users/yourUsername/Library/Android/sdk"
export PATH=$ANDROID_HOME/emulator:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
please check here

Related

React-Native trying to run android, getting an error about /bin/sh: /usr/local/share/android-sdk/platform-tools/adb: No such file or directory

I have updated my $PATH to include the correct location of my adb sdk, but react-native is insisting on using /usr/local/share/android-sdk, instead of /Users/username/Library/Android/sdk/platform-tools. Is there another way to change this? It will not run my android emulator because of this error.
Here is my path:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/Library/Android/sdk:Users/username/Library/Android/sdk/platform-tools
bash profile
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
export ANDROID_HOME=/Users/username/Library/Android/sdk
export ANDROID_SDK=/Users/username/Library/Android/sdk
export PATH=$PATH:/Users/username/Library/Android/sdk
export PATH=$PATH:/Users/username/Library/Android/sdk/platform-tools
So, the bash_profile ANDROID_HOME wasn't being recognized, or something. I had to run this in the terminal
export ANDROID_HOME=/Users/username/Library/Android/sdk
to get it to work. Finally did, thanks for your answers!

Getting error to run ionic app on android device

This is my first ionic app.When I am try to run app on android then I am getting error.I searched many answer but nothing worked for me.
Error: Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/Users/arpansarkar/Library/Android/Sdk (recommended setting)
ANDROID_HOME=/Users/arpansarkar/Library/Android/Sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.
I am export all require thing in my .bash_profile and I have android studio installed.
Please help me...Thanks..
export JAVA_HOME=$(/usr/libexec/java_home)
export ANDROID_SDK_ROOT=$HOME/Library/Android/Sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export GRADLE_HOME=/Users/arpansarkar/Development/gradle-5.5.1/bin
this is my .bash_profile.
Can you please provide what is the result of "ionic info" command?
This is my path settings by which I'm able to create an android build.
export GRADLE_HOME=/opt/gradle/gradle-5.4.1
export PATH=$PATH:$GRADLE_HOME/bin
export ANDROID_HOME=/home/prachishah/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools

android target: android: command failed with exit code enoent Meteor

I have meteor project and I try to start it on my mobile device. It starts successfully if I run project on my windows pc and I'm getting this error(error in title) when I try to start it in my linux(ubuntu) pc. Did everything from mobile tutorial on official site of meteor and still can't start a project. I saw a lot of almost the same questions but they hadn't correct answers for me.
Try run your this command in your terminal:
echo $ANDROID_HOME
it should return something like this
/home/ivan133/Android/Sdk
If it returns empty string execute these commands and build again
export ANDROID_HOME=${HOME}/Android/Sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
Next, it would be nice to add it to your ./bashrc (if you're using bash)
Just open ~/.bashrc with text editor and copy the strings to the end
I had followed the above instructions to no avail. Realized the /tools folder was somehow missing from the /sdk folder. Also it's sdk not Sdk for me.
Complete instructions:
Double check where your sdk folder is. Should be something like:
/User/example-user/Library/Android/sdk
Visit https://developer.android.com/studio?pkg=tools and download the SDK tools package
Extract the contents of that. Should result in a directory named tools
run open /User/example-user/Library/Android/sdk
Place the tools folder into /sdk (so just to be clear, it will be at /User/example-user/Library/Android/sdk/tools
You can then do the following:
export ANDROID_HOME=${HOME}/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
meteor remove-platform android
meteor add-platform android
To check the environment variables first
env
If env variable not available means open or create .zprofile or .zshrc file in your HOME folder.
touch ~/.zprofile; open ~/.zprofile
or
touch ~/.zshrc; open ~/.zshrc
Added these lines
export ANDROID_HOME=${HOME}/Library/Android/sdk
export ANDROID_SDK_ROOT=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
After added that variable and run this below comment
source ~/.zprofile
or
source ~/.zshrc
and it started to work
Now again to verify to type comment line
env
Check the env variable availability
I added these lines
export ANDROID_HOME=${HOME}/Android/Sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
to ~/.zshrc file
and it started to work

android SDK path not working for Ubuntu 16.04

I am trying to run a phonegap app on my Ubuntu machine.
I a getting the error related to the path for the ANDROID_HOME.
This is what I have in my bash_profile
export ANDROID_HOME=/home/suraj/Android/Sdk
PATH=$PATH:$ANDROID_HOME/home/suraj/Android/Sdk/tools
PATH=$PATH:$ANDROID_HOME/home/suraj/Android/Sdk/platform-tools
After putting this I am doing source ~/.bashrc to restart.
What is wrong here?
I do not see any reference to the Android SDK in the output of "echo $PATH".
Make sure your PATH variable contains the Android SDK.
Try to add the following lines to you .bashrc and then source it.
export ANDROID_HOME=/home/suraj/Android/Sdk
PATH=${PATH}:${ANDROID_HOME}
PATH=${PATH}:${ANDROID_HOME}/tools
PATH=${PATH}:${ANDROID_HOME}/platform-tools
Path's are not set properly in your bashrc:
export PATH=$PATH:/home/suraj/Android/Sdk
export PATH=$PATH:/home/suraj/Android/Sdk/tools
export PATH=$PATH:/home/suraj/Android/Sdk/platform-tools
export PATH=$PATH:/home/suraj/Android/Sdk/Sdk/build-tools
source ~/.bashrc
echo $PATH

getting error ANDROID_HOME is not set and "android" command not in your PATH. by trying to build

I get this error with the commane emulate or build despite the .profile's update :
export ANDROID_HOME="/usr/local/android-sdk-linux/tools"
export ANDROID_PLATFORM_TOOLS="/usr/local/android-sdk-linux/platform-tools"
export PATH="$PATH:$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS"
My emulator is correctly launched (nexus 7) and I installed all the necessary Android packages via the android command.
its suppose to be like this
export PATH=${PATH}:/usr/local/android-sdk-linux/platform-tools
export PATH=${PATH}:/usr/local/android-sdk-linux/tools

Categories

Resources