Solved

Trying to create first android project in eclipse

Posted on 2010-11-23
17
1,131 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
 
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
New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now