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.
Related
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
how can i fix this problem ? when i using dryrun. log is here.
➜ ~ dryrun git#github.com:cesarferreira/android-helloworld.git
Searching for devices...
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:211:in
spawn': No such file or directory - /platform-tools/adb
(Errno::ENOENT) from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:211:in
popen_run' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:99:in
popen3' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun/dryrun_utils.rb:50:in
run' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun/dryrun_utils.rb:46:in
run_adb' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun.rb:108:inpick_device' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun.rb:171:in call' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/bin/dryrun:5:in
' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/bin/dryrun:23:in load' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/bin/dryrun:23:in'
The problem you're receiving is dryrun not being able to recognize an adb path. The adb path needs to be set to ANDROID_HOME, for dryrun to work.
Steps to Fix this:
echo export "ANDROID_HOME=/Users/yourName/Library/Android/sdk" >> ~/.bash_profile
source ~/.bash_profile
echo $ANDROID_HOME
Test dryrun git#github.com:cesarferreira/android-helloworld.git 🎉
From the documentation:
ANDROID_HOME needs to be set with the adb path.
Open the file ~/.bash_profile (~/.zshenv if you are using Zsh) or create it if it does not exist, and add the following (with your real Android SDK path):
export ANDROID_HOME=/Users/{your_user}/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
You need to set your ANDROID_HOME
I have obstacle when run sudo ionc build android.
Error log terminal:
Set enviroment varibale in .profile:
Please give me solutions. How to setting PATH that true.
The system is not able to find the environment variable ANDROID_HOME in your .bashrc file. To resolve this error, you need to add the following to line to your ~/.bashrc file:
export ANDROID_HOME="<path/to/your/sdk/without/quotes>"
For me, I added the following
export ANDROID_HOME="/Users/chi6rag/Library/Android/sdk"
And ran source ~/.bashrc so that the configuration is loaded.
I have downloaded NDK for my eclips juno....now i have to add the NDK to path and have to add lines to .bashrc.
I have to add the following lines to my .bashrc
export ANDROID_NDK=/_path_to/android-ndk-linux/
export ANDROID_SDK=/_path_to/android-sdk-linux/
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK
In my terminal I wrote....
~/.bashrc
But it says bash:
/home/user/.bashrc: Permission denied
how can I change permission to write to .bashrc?????
When you type on the command line:
~/.bashrc
You are requesting that the shell execute the file. If you want to edit the file, try:
nano ~/.bashrc
Replace nano with the name of your favorite editor.
If you just want to copy and paste those three lines into your file, you don't really need an editor. Just run the following:
cat >>~/.bashrc
Then, copy and paste those three lines. Then press enter and type control-D and you are done.
I have gone through this NDK example link.And i did all.But ndk-build not working(command not found).I tried ./ndk-build also but no success.I set the path variable too.I am using Ubuntu OS.Any help.Ndk path in bash.bashrc file is like this:
export NDK_HOME=/home/android/android-ndk-r8e-linux-x86/android-ndk-r8e/
The big problem is i am doing cd to this folder in command prompt and doing ndk-build and it's not working.The file inside this filder is ndk-build.cmd
If you want to run ndk-build this way, you need the path of the executable file to be in the PATH env variable. Otherwise you have to specify the entire path to ndk-build. For instace /home/username/ndkpath/ndk-build
Seems that you have get wrong the path, instead use
export NDK_HOME=/home/android/android-ndk-r8e-linux-x86/