Solved

Trying to create first android project in eclipse

Posted on 2010-11-23
17
1,134 Views
Last Modified: 2012-05-10
I'm trying to create a test android project in eclipse but having trouble setting up the sdk.

I'm running eclipse 3.5.2 with gef and the adt plugin installed.

I downloaded and extracted the android sdk from here:
http://developer.android.com/sdk/index.html

Then in eclipse I go to Window->Preferences->Android and point the "SDK location" to
/home/ollie/dev/java/libraries/android-sdk-linux_x86
(I think this is correct because eclipse is asking for the parent of the "tools" directory)

However when I click Apply no targets are loaded and when I go to "Window->Android SDK and AVD Manager", I get the error message:
"Location of the Android SDK has not been setup in the preferences."

0
Comment
Question by:opike
  • 8
  • 5
  • 4
17 Comments
 
LVL 2

Expert Comment

by:phodges4
ID: 34199099
Just for sanity reasons try moving the SDK into the root of your home folder and open a terminal and type:

sudo chown -R ollie:ollie /home/ollie/android-sdk-linux_x86
sudo chmod -R u+rw /home/ollie/android-sdk-linux_x86

This is assuming you're logged in as the user 'ollie'

If this doesn't work I would try uninstalling the plugin.  Redownloading the SDK and going through the process with a clean slate.  I just went through the install without a hitch a minute ago.  What flavor of linux are you running?  What is the output of:

uname -a

0
 
LVL 2

Assisted Solution

by:phodges4
phodges4 earned 250 total points
ID: 34199142
Another question, did you add the SDK/tools path to your PATH environment variable.  If you have try running 'android' from a terminal.  If you have not, in a terminal, navigate into the SDK/tools folder and run:

./android

From there select additional SDK packages that might be relevant to the version you would like to build against.
0
 
LVL 3

Expert Comment

by:alpharom
ID: 34199258
did you set the path variable

try following this tuto

http://www.talkandroid.com/android-sdk-install-guide/
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 3

Expert Comment

by:alpharom
ID: 34199281
0
 

Author Comment

by:opike
ID: 34200989
Just tried adding SDK_ROOT to my PATH environment variable and restarting eclipse. I get the following error when it comes back up:

"Error Loading the SDK:

Error: Error parsing the SDK.
/home/ollie/dev/libraries/android-sdk-linux_x86/platforms is missing."

Do you guys have a platforms/ folder when you unpack the SDK gzip?

0
 
LVL 3

Assisted Solution

by:alpharom
alpharom earned 250 total points
ID: 34201047
i'm working with android under windows seven,
i installed it once on ubuntu and it was OK.
0
 

Author Comment

by:opike
ID: 34201059
So I look in the "SDK README.txt" and I see this bit:

"In order to start developing applications, you must install at least one
version of the Android platform using the SDK Manager.

This requires an Internet connection, so if you plan to use the SDK
offline, please make sure to download the necessary components while online.

To start the SDK Manager, please execute the program "tools/android".

From the command-line you can also directly trigger an update by
executing:
  tools/android update sdk"

So I run tools/android from the command line and it gives me the same "blah blah blah ...linux_x86/platforms is missing." message.

So I create the platforms folder manually and run "tools/android" again and I now I get the message:
"Error: Error parsing the sdk.
Error: /home/ollie/dev/java/libraries/android-sdk-linux_x86/add-ons is missing.
Error: Unable to parse SDK content."
0
 

Author Comment

by:opike
ID: 34201062
I'm on centOS 5.5.
0
 

Author Comment

by:opike
ID: 34201069
How did you guys get your platforms/ directory?
0
 

Accepted Solution

by:
opike earned 0 total points
ID: 34201183
Unbelievable. I had to create the add-ons folder manually as well and then it worked. Can't believe the utility doesn't do this automatically or that these empty folders aren't packaged into the gzip. And of course no mention anywhere in the docs.
0
 
LVL 3

Expert Comment

by:alpharom
ID: 34201223
congratulations ;)
0
 
LVL 2

Expert Comment

by:phodges4
ID: 34201530
The empty dir does exist in the SDK I downloaded.  I wonder if the tool you used to extract it omitted empty dirs?  Just for laughs try extracting the SDK again to another location. What tool did you use to extract?
0
 

Author Comment

by:opike
ID: 34201579
I used the built on archive manager in gnome, file roller. I downloaded wth windows .zip file to see if the directories where in there and didn't see them either. It could be an issue with the most recent packages.
0
 
LVL 2

Expert Comment

by:phodges4
ID: 34201892
I downloaded from the link:

http://dl.google.com/android/android-sdk_r07-linux_x86.tgz

That version actually had the add-ons folder in it
0
 

Author Comment

by:opike
ID: 34212973
It's something specific with centos. I just extracted it on ubuntu and the folders were there.
0
 
LVL 2

Expert Comment

by:phodges4
ID: 34230307
This apparently is a bug that was fixed some time ago.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=420961
0
 

Author Closing Comment

by:opike
ID: 34237181
I stumbled across the final answer but the experts helped point me in the right direction.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse apache tomcat admin console 52 97
will india ph work in usa? 21 58
iterator/ListIterator approach 17 26
Which non-HTML GUI front end to use with Java? 3 22
By this time the large percentage of day-to-day transactions have shifted to mobile banking; here are some overriding areas QAs must investigate while testing mobile banking apps.  
Here, we have shared an easy step by step tutorial on how to download instagram images and videos on PC, Android Mobile and iOS mobile.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question