Android_Home is invalid according to appium-doctor - android

In my Macbook, I have set my android home as shown below in the .bash_profile. However, I get an error message saying the path is invalid when I run appium-doctor.
I've verified that I can navigate to the path in both terminal and finder.
export ANDROID_HOME=/Users/cbellard/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export JAVA_HOME=/usr/bin/java
export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export PATH=${JAVA_HOME}/bin:$PATH
export PATH=/usr/local/bin:$PATH
Here is the output from appium-doctor:

I fixed this by replacing the exports in .bash_profile with identical (to human eyes) ones. So, I'm guessing at some point as I was copy-pasting some program changed one or more of the characters to an identical one.

Related

zsh: command not found: emulator

I am trying to run the emulator -list-avds via terminal, but for some reason keep on getting this error.
Here is my .zshrc profile:
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin" # Added by n-install (see http://git.io/n-in$
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH=$PATH:/~nativeGuy/Library/Android/sdk
export PATH=$PATH:/~nativeGuy/Library/Android/sdk/platform-tools
export ANDROID_HOME=$HOME/Library/Android/sdk
You could do a
that_guys_home_dir=~nativeGuy # Do tilde-expansion
PATH=$PATH:$that_guys_home_dir/Library/Android/sdk
This allows you to put other people's home directory into the path. Of course, if you happen to be nativeGuy, you would simpler do a
PATH=$PATH:$HOME/Library/Android/sdk
Since you are using zsh, a more elegant solution, which obviates you from worrying about the correct way of doing tilde expansion, would be to do a
path+=~nativeGuy/Library/Android/sdk
This implicitly sets PATH, because path and PATH are kept in-sync.

React-Native : Setting up Android emulator, JAVA_HOME is set to an invalid directory

I get this error. (I know this might not be React native specific and i also tried other solutions i still don't come right.)
ERROR: JAVA_HOME is set to an invalid directory: ”/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home”
I just installed jdk 8, This is how i did the export.
export JAVA_HOME=”$(/usr/libexec/java_home -v 1.8)”
And added to ~/.profile
vi ~/.profile, //then added : export JAVA_HOME=”$(/usr/libexec/java_home -v 1.8)”
Below is the error i get whe i run react-native run-android
What do you get when you execute which java from your command line?
On my machine I get /Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home/bin/java
and it is because I have exported my JAVA HOME as follows:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home
and then I have :
export PATH=$JAVA_HOME/bin:${PATH} to make sure that this JAVA_HOME is set before the system's.

ANDROID_HOME is not set (Ubuntu 16.04)

I have followed all steps mentioned from here
I have set ANDROID_HOME and set PATH in bashrc file.
export ANDROID_HOME=/home/sanjay/Android/Sdk
export PATH=$PATH:/home/sanjay/Android/Sdk/tools
export PATH=$PATH:/home/sanjay/Android/Sdk/platform-tools
But still the error "environment variable is not set", "It should be set to SDK home directory" pops up every time I try to build an app.
Please help to resolve this issue..
Remove the spaces betwen the path and ANDROID_HOME in this line:
export ANDROID_HOME = /home/sanjay/Android/Sdk
such that it reads:
export ANDROID_HOME=/home/sanjay/Android/Sdk
It is not that difficult but you got to make your project make know weatabouts of your SDK.
Try following in your terminal
temporary option: In terminal root of your project
export ANDROID_HOME=[sdk location]
gradle build
===================================
adding path permanent:
Linux - ~/.bashrrc
export ANDROID_HOME=[sdd location]
export PATH=$ANDROID_HOME:$PATH

Ubuntu / Elementary OS cannot set ANDROID_HOME

I'm facing the problem, that i cannot set the ANDROID_HOME path variable.
I added the following lines to my bashrc file:
# Android Path
export ANDROID_HOME=~/android-sdk/Sdk/tools
But when i try to access android via the terminal i get this error:
android: command not found
How can i solve this problem?
You need to add the variable in your PATH as well. The aim is for your PATH variable to contain the complete folder path, in which the file 'android' is present.
export ANDROID_HOME=~/android-sdk/Sdk/tools
export PATH=$ANDROID_HOME:$PATH
Don't forget to source your bashrc after adding these lines
source ~/.bashrc
Again, the file 'android' should be present in the tools folder.
Follow the following steps:
1)Open the bashrc file from command line
nano ~/.bashrc
2) Add following lines at the top.
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
3)Now, quit terminal and re-launch, and try typing:
adb -h
android -h
If both commands are giving you output, it means everything works fine.

Start a ionic project in linux

I am new to ionic framework. I am trying to start a ionic project. I install cordova and when I'm going to add the android platform to the project using 'ionic platform android' it gives me this error.
an error occurred while listing android targets
I also set the path to android sdk and ant by adding following lines to my .bashrc file
export ANDROID_HOME="$HOME/android-bundle/sdk/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/android-bundle/sdk/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
export ANT_HOME="$HOME/ant"
export PATH="$PATH:$ANT_HOME/bin"
But still I get the above error. Any kind of help would be appreciated.
try this in you .bashrc file.
export ANT_HOME="/usr/bin/ant"
export PATH="$PATH:$ANT_HOME/bin"
export HOME="/home/username"
export ANDROID_HOME="$HOME/android-bundle/sdk/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/android-bundle/sdk/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
I always explicitly define the paths globally.
Mine looks a little like this - from the terminal I type:
export PATH=${PATH}:~/dev/adt-bundle-linux-x86_64-20140321/sdk/tools
export PATH=${PATH}:~/dev/adt-bundle-linux-x86_64-20140321/sdk/platform-tools
If this doesn't work, try updating the sdk
type in your linux terminal:
export PATH=$PATH:/usr/lib/android-sdk-linux
export PATH=$PATH:/usr/lib/android-sdk-linux/tools
export PATH=$PATH:/usr/lib/android-sdk-linux/platform-tools

Categories

Resources