Solved

Trying to create first android project in eclipse

Posted on 2010-11-23
17
1,128 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A brand new malware strain was recently discovered by security researchers at Palo Alto Networks dubbed “AceDeceiver.” This new strain of iOS malware can successfully infect non-jailbroken devices and jailbroken devices alike.
Let Bitmoji into your life. Now is the time to learn a new language of smartphone messaging with this brief introduction.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

746 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

16 Experts available now in Live!

Get 1:1 Help Now