Linux Mint Android SDK Path Issue - android

I'm not able to include the android sdk to my PATH variable, so that I can use "android" from terminal.
I was following this tutorial to enable phonegap (which is my primary goal http://julianhigman.com/blog/2013/10/17/notes-on-setting-up-phonegap-on-ubuntu-for-android-app-development/)
First I took a look at the official android dev page
http://developer.android.com/sdk/installing/index.html?pkg=studio
It says:
"You may want to add android-studio/bin/ to your PATH environmental variable so that you can start Android Studio from any directory."
So I extended my .bashrc file with following lines
export PATH="/usr/local/android-sdk/android-studio/bin/:$PATH"
This points to the correct path as described in on the dev page.
Since this does not work I did some deeper research and found several threads which did not help either.
(Android command not found even PATH set)
Most recommend to do the following:
export PATH=${PATH}:/usr/local/android-sdk/tools
export PATH=${PATH}:/usr/local/android-sdk/platform-tools
The problem here is, that I dont have any folders named tools or platform tools?
I'm running on Linux mint 16.
If anyone could point me in the right direction, that would be great!
Update:
echo $PATH results to:
/usr/local/heroku/bin:/home/foo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools:/usr/local/android-sdk/android-studio/bin
But I added only this line
Added to enable android on the path
export PATH="/usr/local/android-sdk/android-studio/bin:$PATH"
Update
Had to install the packages after for android sdk and added them successfully to the .bashrc, now android is available.
Thanks in advance
Best

Related

Android studio path is not recognized

This is my problem:
What I tried:
Re-installing.
Doing what it tells me to do on the picture.
I added the java jdk to my environment variables.
Nothing of those things worked.
Anyone got a clue?
The problem is not your JDK. As the error says, the problem is that it can't find the Android SDK.
The path that you put into that box should be something like /Users/<user_name>/Library/Android/sdk (OSX) or C:\Android\SDK (Windows), depending on where you have installed the Android SDK.
There are two ways to solve this problem:
Download the android standlone sdk from Android developer site
make a directory consisting of android sdk's in your computer and provide that directory path to that pop up.
Provide the sdk path (the default path is : /opt for Linux based OS and C:\Android\SDK or something like this for windows...
There can be several other ways. You can get more info # Android developer site for details

Error building Android project in Cordova

I am new to Cordova and I am trying to build my project, which was previously working. I believe I have a bug. I am not very experienced with the terminal so I don't know how to resolve this. I have tried uninstalling and reinstalling cordova, as well as updating it with no success. Here is my error:
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /Users/joshuaoconnor/Desktop/PBBars/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/joshuaoconnor/Desktop/PBBars/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
and here is the full image of the terminal
Your running in a standard "beginners" issue by using cordova or phonegap - but no problem, we are here to help you ;-)
The Terminal tells you, that:
ANDROID_HOME is not set and "android" command not in your PATH.
So, you $PATH is a SystemVariable which "saves" pathes to important files and folders. All files, which are part of the SystemVariable $PATH can be called via your Terminal. So because i don't know, which OS you are using, i'm going to post two solutions. One for each, mac and windows.
Before you start: The PATH is a SystemVariable which is needed as it is. Another folder can be added by a : which seperates the single folders and pathes inside your PATH. If you do anything wrong there, your system may never work correct again without reinstalling it - be carefull and do not delete any of the PATHs content which is already there.
What do i need in my Path? (especially for Cordova/PhoneGap now)
So you need three things in your Path:
%ANDROID_HOME%
tools
platform-tools
How can i see my actual $PATH?
echo $PATH on a mac
echo %PATH% on windows
How to set up the PATH Variable on Windows
Select your Computer from the Start Menu.
From the Contextmenu select System properties.
After that select the advanced tab.
In that section you click on Environment Variables.
So in the section System variables you're going to find the Path which can be edited over there.
How to set up the PATH Variable on Mac OS X Yosemite
Open your terminal and go on like this:
vi $HOME/.bash_profile
Add a line there with this content:
export PATH=$PATH:new/dir1/:dir2:/dir/path/new
This changes will be loaded after a reboot - to apply them immediatly after you changed it, save and close your file and type source $HOME/.bash_profile.
If you have any further questions, let me know - i'm going to edit my answer than.
By the way: There is a great Documentation on how to install Android-Platform on Windows machines. It can be found here, inside the Apache Cordova Docs -> Android - Shell-Tools Guide
Look for the local.properties file and add the correct path to your sdk sdk.dir=/home/somewhere/android-sdk/sdk
I would suggest to generate the project using cordova but build it using Android Studio, since you will probably want to tune one or two things on your android project anyway.
EDITED:
It seems you are on windows, so a quick way would be to set an Environment Variable called ANDROID_HOME pointing to the directory where you downloaded the android sdk as per the Cordova documentation
Either that or the steps stated on the documentation:
To modify the PATH environment on Windows 7:
Click on the Start menu in the lower-left corner of the desktop,
right-click on Computer, then select Properties.
Select Advanced System Settings in the column on the left.
In the resulting dialog box, press Environment Variables.
Select the PATH variable and press Edit.
Append the following to the PATH based on where you installed the SDK,
for example:
;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools
I was able to figure an answer out on my own. Coming from a complete beginner with no experience with bash profile, I was lost with your instructions (no offense). To fix this issue, learn how to edit your PATH environment variables. I used this tutorial (http://hathaway.cc/post/69201163472/how-to-edit-your-path-environment-variables-on-mac) which showed how to do it with textedit. After I learned how to edit my PATH variables, I added
export ANDROID_TOOLS="/Users/joshuaoconnor/Documents/sdk/tools"
export ANDROID_PLATFORM_TOOLS="/Users/joshuaoconnor/Documents/sdk/platform-tools"
to my BASH profile. Sithys and Logains answers did not work for me.

Titanium Studio cannot find Android SDK (tried multiple solutions)

Okay. I'm kind of at my wits' end here. I've been trying for about 2 days to set up Titanium Studio to recognize and connect to the Android SDK (Windows 7). I have tried multiple solutions (below) with no luck. There's got to be something I'm missing. I've tried Google and the Titanium developer guides. So this is my last straw. Any ideas?
Android SDK home path is C:\Android\android-sdk (to avoid spaces with "Program Files")
installed all SDKs (3,4,7,8,10,11,12,13,14,15), their Samples, and all Google APIs
installed all "Extras" packages
Added both the Android tools and platform-tools directories to Windows' PATH variable
Copied adb.exe from platform-tools to tools as Titanium likes to look there for adb
Installed the current master build of Titanium SDK for Mobile Devices
Created Android Virtual Devices (AVDs) for SDKs 7 and 8 (Titanium's required SDKs)
Restarted adb server and computer itself after each change
On the Titanium 'Dashboard' tab, under 'Configure', I get:
An Android SDK is missing. Titanium requires Android platforms 2.1.* and 2.2.*
When attempting to set the default Android SDK path in 'Preferences', I get:
Could not locate the Android SDK at the given path
Titanium log file output (sorry, kinda long):
!ENTRY com.appcelerator.titanium.mobile 4 0 2012-02-22 14:06:21.992
!MESSAGE (Build 1.0.0.1327639206) [ERROR] [ERROR] The system cannot find the path specified.
[ERROR] The system cannot find the path specified.
Traceback (most recent call last):
File "C:\Users\Stick\AppData\Roaming\Titanium\mobilesdk\win32\2.0.0.v20120221190136\android\avd.py", line 45, in <module>
print get_avds(sdk)
File "C:\Users\Stick\AppData\Roaming\Titanium\mobilesdk\win32\2.0.0.v20120221190136\android\avd.py", line 21, in get_avds
for line in run.run([sdk.get_android(),'list','target'],debug=False).split("\n"):
AttributeError: 'NoneType' object has no attribute 'split'
I have no idea what's missing. Eclipse recognizes everything just fine. ANY suggestions??
P.S.
I've noticed that when I attempt to run 'android' commands, i.e.
android
android list targets
I get what seems to be an error:
The system cannot find the path specified.
However, the commands still continue to run with no issues (I get a list of all the targets and the SDK Manager pops up). I'm not sure whether or not whatever is causing that message is also causing Titanium headaches.
I was facing the exact same issue, but now I have figured this out and it was working fine.
Basically, when I install Titanium Studio and I configure Android SDK it worked fine, but when I try to execute Project there was "javac not found" error. While resolving this issue I came across a Post where it was mentioned to include '%JAVA_HOME;%' in your Path. And when I did this the Android SDK was not longer detected by Titanium.
I removed the '%JAVA_HOME%' from Path Variable and then I include Java bin Folder Path to Path Variable and created a new variable 'JAVA_HOME' which points to root directory of Java installation. Everything works fine after doing this step.
I hope you will now get your Titanium Environment running. :-)
Thanks.
Newer version of Titanium have the Update Android SDK option in the Dashboard. Just make sure, the path is correct. Some cases like mine, there might be two Android SDK paths; one was obsolete and the other was active. So, please make sure of that path. When Titatnium is about to update the SDK software, looking in for newer versions, please select Cancel, as that wouldn't be required!
open titanium ide.
click on file-> titanium mobile project.
a window will show up with a link Set-up/Configure SDKs in the
bottom. click on this link.
now give android sdk home: c:\Androi\android-sdk (or browse to
android-sdk folder in your system)
select the default Android Sdk
click Apply
Click Ok.
You should be good to go.
Let me know if you face any problems.

Android: NDK setup in windows

I've been planned to develop an Augmented_Reality(AR) application in an android. So I've gone through various of contribution installing a libraries in eclipse(IDE) like artool,qcar sdk and so on, then I've found that NDK installation should be made before getting into artool kit or qcar sdk So I started to install NDK and progressed as they said in below link:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
after doing 'Cygwin' installation they wrote to write 'make -v' in console. Hhen I did I got 'GNU make 3.82.90' but theirs is 'GNU make3.81' as:
where it wasn't as same mine. I know that am using updated cygwin but my problem is I can't able to get .so file as they mentioned accordingly in eclipse. So could you tell me, where I made junk and how can I recover to run AR application in eclipse. Thank you!
actually if you are using window then you do not need to install cygwin. you can also run your project with cmd prompt with following command
start>cmd>cd C:\demoworkspace\testingndk>enter
in Command prompt This is my directory where my project is located with project name. after this
run the ndk address like
C:\demoworkspace\testingndk>C:\ndk-path\ndk-build
ndk-path is directory name where your ndk is located. this will automatically pick your jni c file.
for ndk related query please write me at kdeepak5477#gmail.com
When you are installing cygwin (I used a wizard) make sure you open the DEVEL tree and install MAKE (binary is fine, no need for source).
I also get all the GCC and MINGW stuff just in case.
Perhaps uninstall cygwin, and reinstall using the wizard and ensure MAKE is selected from DEVEL tree.

TitaniumStudio - Android SDK

I've tried every possible way I can think of and followed every forum list I can find, still to no avail. I'm trying to get the Android SDK to be recognized by TitaniumStudio. I installed in by going through the folders and running it that way, I've tried the command line option, I've installed it through Eclipse (which it works in) but TitaniumStudio STILL will not recognize it. I've reinstalled TitaniumStudio, that didn't work.
Key Points:
Everything is up to date
I'm working on Mac OSX 10.6.8
I know of Terminal and what it can do, but don't know Unix commands
The above is probably significant because somewhere in a forum someone mentioned changing the PATH for the sdk to read the /tools and /platform-tools folders using the /.bash_profile (I think that's what it's called, correct me if I'm wrong there) but when I tried to run the command via terminal to create an AVD (android create avd -n android_sdk -t 2 (android_sdk being the AVD name and 2 to point to the android-4 platform)), i get the following error:
-bash: android: command not found
Please help me with some insight into this "-bash" and what that is and how to fix this annoying problem! >.<
EDIT: I've gotten it to a point where I now get the following error when I try to send (android create avd -n android_sdk -t 2) through terminal:
Valid ABIs: no ABIs.
Error: This platform has more than one ABI. Please specify one using --abi.
What the heck does that mean and what's an ABI?? o.O
Run tools/android, It'll fire up a "Android SDK Manager" where you would see various platforms listed and the ABI's for those platforms underneath them. For example when I fire up my "Android SDK Manager", I see Android 4.0 (API 14) and then underneath it is "ARM EABI v7a System Image". Check this package and install it. Confirm that ABI's are indeed listed by running the command "android list targets".
Remember to start a new terminal when you are making changes to .bash_profile or .bashrc files. Failing to do so, would lead to errors like you are experiencing because the changes isn't loaded in, and the new PATHs and all the programs there isn't available to you.
With that being said, you need to add the folder with binary programs to your path, you can verify that the path is loaded in with the following command:
echo $PATH
Which gives me this on Snow Leopard:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Setting a path can be difficult in OSX because it seems like they have changed this behavior quite a bit between releases.
Look here for a more detailed answer about setting path variables: https://superuser.com/questions/69130/where-does-path-get-set-in-os-x-10-6-snow-leopard
There is also a description here on how to get Snow Leopard to read the user supplied .bashrc in the home-dir: http://kaspergrubbe.dk/2011/enable-bashrc-on-osx-snow-leopard-and-lion/

Categories

Resources