How to setup ADT (Android Development Tools) on 64bit Fedora 17 ?


Quick Intro

Yesterday I was excited to receive a task to install ADT for Eclipse and Android SDK on my machine , I thought it would be a “piece of cake”, so with a high level of excitement I have started….

As I use  my laptop with Fedora 17 (64bit) for all my developments, I have decided that I will put my Android Development Tools in it as well.

Installation…

As my first step I went to the http://developer.android.com/sdk/index.html and thankfully there is ADT bundle for Linux 64-bit, which consists of custom version of Eclipse Juno, equipped with everything one needs for Android development and  Android SDK that includes such tools as Android debugger and Emulator.

After downloading Android SDK I have run Eclipse, and surprisingly, instead of default Eclipse intro, ADT-equipped Eclipse has fancy intro:

adt-intro

ISSUE 1: Android Project Replaced with Android Application Project

After Eclipse has fully loaded, I have decided to create an Android Project. My instructions said that I need to go to File -> New – >”Android Project”. Unfortunately, the version that I have installed does not have option “Android Project”. Closest option to “Android Project” was “Android Application Project”. Here is the screenshot:

Android Development_tools_create_project

After trying to find “Android Project” for at least half an hour, I have discovered that other people have the same issue:

http://stackoverflow.com/questions/11329753/no-android-project-option-in-eclipse
http://stackoverflow.com/questions/11604641/difference-between-android-application-project-and-android-project

Solution:

So my decision was to use “Android Applciation Project”, I have just unchecked option to select launch icon.

I have set Project name, Package name and Activity. Everything seemed to be fine and my project was populated with whole bunch of android related files.

ISSUE 2: R Cannot be resolved to a variable   and adb cannot be found

After project files were generated I have faced my next problem. In my src file I had 2 errors regarding “R” which cannot be resolved. After doing a research again I have found out that even more people have the same issue:

http://stackoverflow.com/questions/7906606/after-installing-android-adt-14-r-cannot-be-resolved
http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error
http://stackoverflow.com/questions/8266100/r-cannot-be-resolved-in-eclipse-android-project
http://stackoverflow.com/questions/7824730/r-cannot-be-resolved-to-a-variable
…………

Most of the advices were to clean and rebuild the project which did not gave me any results. One of the advice was to install ia32-lib, however this library is available for other “distros”, but not Fedora.
After 2 hours of trying different stuff, which did not work, I have found out the cause of the problem.

Reason of the error:

The reason why R cannot be resolved is because R should point to the R.java file, which is auto generated and is located in the gen folder. In our case R.java was not generated, thus Eclipse was not able to resolve it.

Together with “R cannot be resolved” error, Eclipse Error Log gave me one more error which looked like this:

Unexpected exception 'Cannot run program 
"/home/aspektor/adt-bundle-linux-64/sdk/platform-tools/adb": error=2 
No such file or directory' while attempting to get adb version from

It looked to me that these problems are connected.

Solution:

After couple of hours of trying tons of different things, I have realized that the reason of the problem is that Android SDK is initially intended for 32 bits. As I have 64bit Linux I need to install additional 32bit packages to make it work.

Thankfully I have found wonderful guide, that helped me in solving most of my issues:

http://fedoraproject.org/wiki/HOWTO_Setup_Android_Development

I have run this command to install 32bit packages:

# yum install glibc.i686 glibc-devel.i686 libstdc++.i686 
zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 
libXrender.i686 libXrandr.i686

I have also set up PATH in ~/.bash_profile so adb and other tools can be found:

export ANDROID_SDK_HOME=/home/aspektor/adt-bundle-linux-64/sdk
PATH=$PATH:$HOME/adt-bundle-linux-64/sdk:$HOME/adt-bundle-linux-64/tools
export PATH
# For SDK version r_08 and higher, also add this for adb:
PATH=$PATH:$HOME/adt-bundle-linux64/sdk/platform-tools
export PATH

Finally, I have restarted Eclipse, cleaned and rebuild my project and 5 hours later..... tired but satisfied I have created ADV (emulator) and run my ADT project.

Thankfully it worked:

eclipse-works

After-thoughts…

I think it would be reasonable for Android website to ADVICE (put it in bold and somewhere where everyone could see? ) people who have 64-bit Linux need additional 32 bit libraries. It would save folks like me a lot of time. Not saying that these packages should be per-requisite before downloading bundle :)

If you have any other comments, go ahead, I would love to hear them!

Regards,

Anatoly

About these ads

About Anatoly Spektor

My name is Anatoly Spektor (originally Anatolijs Spektors) I am Software and Web Developer. I have worked in Seneca Center for Development of Open Technology on Big Blue Button Add-on - Polling Module. Currently, I am employed as Software Engineer in Red Hat.
This entry was posted in Android, Eclipse Development, Fedora, open-source, OS and tagged , , , , , , , , . Bookmark the permalink.

15 Responses to How to setup ADT (Android Development Tools) on 64bit Fedora 17 ?

  1. Hi Anatoly,

    I think it’s really great what you are doing with your programming blog, and you’ve got great insights in your field. I especially like your use of images in this post and step-by-step instructions on how to set up an ADT. As an expert in topics such as software dev and resources for the API community, I’m are reaching out to you to participate in an API community we’re building.

    If you decide to join, we will publish the title of your posts and the first few sentences of each post on an API website. If readers want to read the full story, they’ll be pushed to your blog. The benefits are straightforward: increased exposure and more traffic to your site.

    If you’re interested or have any questions, please send me an email with “API” in the subject line and I’ll send you a link to activate your account (or an answer questions).

    I look forward to you joining our community!

    Kindest regards,
    Tina Jin

    • Hey Tina,

      Thank you for contacting me, I am glad that you like my blog!

      Regarding your offer, could you please post your email address so I can follow up with you!

      Thanks,

      Anatoly

  2. Thanks for ones marvelous posting! I actually enjoyed reading it, you happen to be a great author.
    I will always bookmark your blog and will come back
    sometime soon. I want to encourage you to continue your great work, have a
    nice weekend!

  3. Ronaldki says:

    Hi to all members on this community i am thanks to the administrator of this forum for approve my account i am sure here i got better knowledge thanks again. My name is Ronald.

  4. diena.org.lv says:

    What’s up, just wanted to mention, I liked this article.
    It was practical. Keep on posting!

  5. football says:

    In the end, you will have assigned 136 confidence points (16+15+14+.

    Do you wear your own football package when actively playing football along with
    friends on the park or even wear your shirt casually around town or perhaps is this
    your ritual to wear your groups colors when going down to the pub.

    I guess a handful of suspensions was enough to satisfy the NCAA.

  6. Saluti da Idaho ! Sono annoiarsi al lavoro così ho deciso di controllare Sito sul mio iPhone durante la pausa pranzo .
    Mi piace di informazioni ti presenti qui e non vedo l’ora di dare un’occhiata quando
    torno a casa . Sono stupito sorpreso di quanto velocemente velocemente il tuo blog caricato sul mio cellulare telefono ..
    sto neanche utilizzando Wi-Fi , 3G solo .. Comunque In ogni modo , fantastico blog !

  7. Hi, I wish for to subscribe for this webpage to get most recent updates, therefore where can i do it please
    help out.

  8. Hey I know this is off topic but I was wondering if you knew of any widgets
    I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you
    would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look
    forward to your new updates.

  9. Hi there, constantly i used to check website posts here in the early hours in the break of day,
    since i enjoy to find out more and more.

  10. By choosing a durable area rug you’ll get your monies
    worth along with the warmth feel when you walk over it barefoot.
    Liability insurance for professionals will ensure that if there are damages that ensue as a result of work that
    is performed you do not have to pay out of your own pocket in order to recoup your
    losses. In the winter, passive solar orientation keeps your home warmer, and in the summer
    it keeps your home cooler.

  11. Monroe says:

    Great goods from you, man. I’ve understand your stuff previous to and you’re just too magnificent.
    I really like what you have acquired here, really
    like what you’re stating and the way in which you say it.
    You make it enjoyable and you still take care of to keep it smart.
    I can not wait to read much more from you. This is actually a wonderful site.

  12. Francesca says:

    Hey there! I just wanted to ask if you ever have any
    trouble with hackers? My last blog (wordpress) was hacked and I ended up losing a few
    months of hard work due to no data backup. Do you have any
    solutions to stop hackers?

  13. beachboady says:

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make
    your point. You clearly know what youre talking about, why throw away your
    intelligence on just posting videos to your blog when you could
    be giving us something informative to read?

  14. At this time I am ready to do my breakfast, when having my breakfast
    coming over again to read additional news.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s