Friday, February 19, 2010

My perfect Android development environment #2

Awhile ago I posted an entry detailing an Android development system based around Kubuntu 9.04. I used this for a while but later moved back to my usual Fedora set-up, based on Fedora 12. Whilst this worked well, I've since been wanting to get back to a KDE based system, but one with good security which Fedora has, but which Kubuntu seems to lack (firewall, and SELinux / Apparmor).

Anyway, I've now completed a working installation using OpenSuse 11.2 on my new Acer Aspire 5332 laptop which I'm very pleased with. I've also found that there are no good guides on-line on how to get Eclipse / Android SDK / OpenSUSE 11.2 to all work together, so if you (like me) have been struggling with this, read on!

Firstly, here's a screenshot of what we're striving for:



  • I used OpenSUSE 11.2 64 bit DVD for my installation. I assume these instructions also work fine for the 32 bit version. First step then, download the OpenSUSE 11.2 DVD from here: http://software.opensuse.org/112/en
  • I installed the system using mainly the default settings. Once complete, I got the laptop on-line and installed all updates, ready to begin the Eclipse / Android SDK installation.
  • Using Yast's Software Manager, I selected 'Patterns' from the 'View' drop-down, and then installed the following three patterns: Base Development; Linux Kernel Development; Java Development.
  • Next to install Eclipse. I found the version in Suse's repository to be problematic, so instead I download the latest version straight from the Eclipse Project web site. The following link is a useful reference to help you do this: http://developer.android.com/sdk/1.5_r3/installing.html
  • Firstly, download the 64 bit Linux version of Eclipse Classic 3.5.1 from here: http://www.eclipse.org/downloads/
  • Next, download the Android SDK from here: http://developer.android.com/sdk/index.html
  • Assuming the two files you just downloaded are in your Downloads folder, follow these steps in a terminal to unpack and install them:

cd ~/Downoad/
tar -xvf eclipse-SDK-3.5.1-linux-gtk-x86_64.tar.gz
tar -xvf android-sdk_r04-linux_86.tgz
su
mv eclipse /usr/local/bin
mv android-sdk-linux_86/ /usr/local/bin
chown -R root:root /usr/local/bin/eclipse        #Do not do this for the android-sdk-linux_86 directory, otherwise you won't be able to install the SDK later!


vi /usr/local/bin/eclipse/eclipse.sh

  • and make it look like this:

#!/bin/bash

export GDK_NATIVE_WINDOWS=1
/usr/local/bin/eclipse/eclipse

  • Save this, then make it executable:

chmod 755 /usr/local/bin/eclipse/eclipse.sh

  • Next, create a new Start Menu item for Eclipse by right-clicking on the Suse KDE Start Button and selecting 'Menu Editor'. Then add the following to the 'Integrated Environment' section of the start menu:

Name: Eclipse
Location: /usr/local/bin/eclipse/eclipse.sh
Description: Java IDE
Icon: /usr/local/bin/eclipse/icon.xpm

  • Start Eclipse, select the default workbench location.
  • Then select Help -> Check for updates.
  • Click 'Available Software sites'.
  • Next set-up the following software sources:

Android SDK 
https://dl-ssl.google.com/android/eclipse/

Galileo 
http://download.eclipse.org/releases/galileo/

The Eclipse Project Updates
http://download.eclipse.org/eclipse/updates/3.5/

  • Install all updates then restart Eclipse. Then
  • Help > Install new software....
  • Select the Location: 
  • https://dl-ssl.google.com/android/eclipse/
  • If you have trouble aqcuiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).
  • Select the checkbox next to Developer Tools and click Install...
  • On the subsequent Install window, "Android DDMS" and "Android Development Tools"
  • should both be checked. Click Next. 
  • Read and accept the license agreement, then click Finish.
  • Restart Eclipse. 
  • Now modify your Eclipse preferences to point to the Android SDK directory:
  • Select Window > Preferences... to open the Preferences panel.
  • Select Android from the left panel.
  • For the SDK Location in the main panel, enter: /usr/local/bin/android-sdk-linux_86
  • Click Apply, then OK.
  • Disable useage stats.
  • Finally download the SDK packages using Window -> Android SDK and AVD manager.
Done! You should now be able to develop Android apps on your smart and secure new OpenSUSE 11.2 installation.

If you get stuck post a comment and I'll try to help. And if it works, post a comment and I'll just feel good!

Thanks for reading, Nick.

21 comments:

  1. Hey, I'm getting this error---What to do?


    Cannot complete the install because one or more required items could not be found.
    Software being installed: Android Development Tools 0.9.6.v201002051504-24846 (com.android.ide.eclipse.adt.feature.group 0.9.6.v201002051504-24846)
    Missing requirement: Android Development Tools 0.9.6.v201002051504-24846 (com.android.ide.eclipse.adt.feature.group 0.9.6.v201002051504-24846) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found

    ReplyDelete
  2. Also, the eclipse.sh file did not open Eclipse for me so I just used the eclipse.exe to launch it. I then tried to install the develop. tools for android and received the previous error msgs. Any help would be greatly appreciated, thanks.

    ReplyDelete
  3. Thanks! I'd struggled for hours and never found Android as an option under Windows > Preferences. Removing everything and following your very clear description, to the letter, worked flawlessly... Magic!

    ReplyDelete
  4. Thanks Angela - I'm glad this worked well for you!

    ReplyDelete
  5. Thanks for writing this, it helped out a lot in getting up and going on an opensuse install.

    ReplyDelete
  6. Thanks a lot Nick for this blog.
    It works fine for me as a new developer for Android.

    ReplyDelete
  7. This worked excellent. I've been trying to figure this out for week. Procedures were generally the similar using eclipse 3.5.2, and android SDK r_06. Awesome job!

    (The real problem is given how good openSuse is, why has their packaged eclipse been so munged up for so long?)

    ReplyDelete
  8. Thanks Ken for the feedback - I'm glad this was useful. I have to agree with your comments regarding Suse. You'd think that for any package to be included in their main repo that it would be tested and fully working, but not in Eclipse's case. Still, can't complain - it is free software!

    ReplyDelete
  9. Hello, I keep getting stuck where I do not see Android on the left panel.

    I am following the instructions to a 'T'. Where am I going wrong?

    Thanks!

    ReplyDelete
  10. hi it is really great...

    Thanks a lot

    Regards,
    N.Sugumar

    ReplyDelete
  11. Just perfect HowTo. Thanks a lot. Regards Ralph

    ReplyDelete
  12. Thanks Nick,

    I've just followed this for Eclipse (Helios) on opensuse 11.2 64 bit.

    thanks for putting this together
    tim

    ReplyDelete
  13. Hi Nick,

    Thanks for this. I've just followed these instructions and installed Eclipse (helios) on OpenSuse 11.2 64 bit successfully.

    thanks
    tim

    ReplyDelete
  14. heloo nick...
    thanks for write a short tutor about eclipse.. but i still found error with Gnome opensuse 11.3 x64 (2.6.34.7.0.5 kernel). I used last galileo eclipse SDK 3.5.2 x86_64.

    Here is my output console

    The program 'Eclipse' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadValue (integer parameter out of range for operation)'.
    (Details: serial 8463 error_code 2 request_code 58 minor_code 0)
    (Note to programmers: normally, X errors are reported asynchronously;
    that is, you will receive the error a while after causing it.
    To debug your program, run it with the --sync command line
    option to change this behavior. You can then get a meaningful
    backtrace from your debugger if you break on the gdk_x_error() function.)

    can u solve the problem ?

    ReplyDelete
  15. Cheers. Would not be able to develop on Android without Eclipse. Such a life saver. Following

    ReplyDelete
  16. if conflict like this, how to remove ? im on 11.4 64bit
    thanks.

    Cannot complete the install because of a conflicting dependency.
    Software being installed: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)
    Software currently installed: Eclipse SDK 3.7.0.I20110613-1736 (org.eclipse.sdk.ide 3.7.0.I20110613-1736)
    Only one of the following can be installed at once:
    International Components for Unicode for Java (ICU4J) 4.4.2.v20110208 (com.ibm.icu 4.4.2.v20110208)
    International Components for Unicode for Java (ICU4J) 4.0.1.v20090822 (com.ibm.icu 4.0.1.v20090822)
    International Components for Unicode for Java (ICU4J) 4.0.1.v20090415 (com.ibm.icu 4.0.1.v20090415)
    Cannot satisfy dependency:
    From: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)
    To: org.eclipse.wst.sse.ui 0.0.0
    Cannot satisfy dependency:
    From: Java EMF Model Utilities 2.0.200.v200905140200 (org.eclipse.jem.util 2.0.200.v200905140200)
    To: bundle com.ibm.icu [3.8.1.1,4.1.0)
    Cannot satisfy dependency:
    From: Java EMF Model Utilities 2.0.201.v201001252130 (org.eclipse.jem.util 2.0.201.v201001252130)
    To: bundle com.ibm.icu [3.8.1.1,4.1.0)
    Cannot satisfy dependency:
    From: Eclipse Platform 3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f (org.eclipse.platform.feature.group 3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f)
    To: org.eclipse.rcp.feature.group [3.7.0.v20110216-9DB5Fm1FpBGy_AaVz-mFamgY]
    Cannot satisfy dependency:
    From: Eclipse RCP 3.7.0.v20110216-9DB5Fm1FpBGy_AaVz-mFamgY (org.eclipse.rcp.feature.group 3.7.0.v20110216-9DB5Fm1FpBGy_AaVz-mFamgY)
    To: com.ibm.icu [4.4.2.v20110208]
    Cannot satisfy dependency:
    From: Eclipse Project SDK 3.7.0.v20110426-7Q7xA7DPb31rE2_TcfD-VPkLqq8sfDmLus7XtaSo-7NHB (org.eclipse.sdk.feature.group 3.7.0.v20110426-7Q7xA7DPb31rE2_TcfD-VPkLqq8sfDmLus7XtaSo-7NHB)
    To: org.eclipse.platform.feature.group [3.7.0.v20110530-9gF7UHNFFt4cwE-pkZDJ7oz-mj4OSEIlu9SEv0f]
    Cannot satisfy dependency:
    From: Eclipse SDK 3.7.0.I20110613-1736 (org.eclipse.sdk.ide 3.7.0.I20110613-1736)
    To: org.eclipse.sdk.feature.group [3.7.0.v20110426-7Q7xA7DPb31rE2_TcfD-VPkLqq8sfDmLus7XtaSo-7NHB]
    Cannot satisfy dependency:
    From: Common Frameworks 1.1.300.v200904160730 (org.eclipse.wst.common.frameworks 1.1.300.v200904160730)
    To: bundle org.eclipse.jem.util [2.0.100,3.0.0)
    Cannot satisfy dependency:
    From: Structured Source Editor 1.1.101.v200908261807 (org.eclipse.wst.sse.ui 1.1.101.v200908261807)
    To: bundle org.eclipse.wst.validation [1.2.0,1.3.0)
    Cannot satisfy dependency:
    From: Structured Source Editor 1.1.102.v200910200227 (org.eclipse.wst.sse.ui 1.1.102.v200910200227)
    To: bundle org.eclipse.wst.validation [1.2.0,1.3.0)
    Cannot satisfy dependency:
    From: Validation Framework 1.2.102.v200905201610 (org.eclipse.wst.validation 1.2.102.v200905201610)
    To: bundle org.eclipse.wst.common.frameworks [1.1.200,2.0.0)
    Cannot satisfy dependency:
    From: Validation Framework 1.2.104.v200911120201 (org.eclipse.wst.validation 1.2.104.v200911120201)
    To: bundle org.eclipse.wst.common.frameworks [1.1.200,2.0.0)

    ReplyDelete
  17. Hello Nick!
    Thanks for the great tutorial!
    However, on openSuSe 11.4 64 bit I get the same error as described above in the previous comment:

    "
    Cannot complete the install because of a conflicting dependency.
    Software being installed: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)
    Software currently installed: Shared profile 1.0.0.1308010175179 (SharedProfile_SDKProfile 1.0.0.1308010175179)
    Only one of the following can be installed at once:
    International Components for Unicode for Java (ICU4J) 4.4.2.v20110208 (com.ibm.icu 4.4.2.v20110208)
    International Components for Unicode for Java (ICU4J) 4.0.1.v20090822 (com.ibm.icu 4.0.1.v20090822)
    International Components for Unicode for Java (ICU4J) 4.0.1.v20090415 (com.ibm.icu 4.0.1.v20090415)
    Cannot satisfy dependency:
    From: Shared profile 1.0.0.1308010175179 (SharedProfile_SDKProfile 1.0.0.1308010175179)
    To: com.ibm.icu [4.4.2.v20110208]
    Cannot satisfy dependency:
    From: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)
    To: org.eclipse.wst.xml.ui 0.0.0
    Cannot satisfy dependency:
    From: Java EMF Model Utilities 2.0.200.v200905140200 (org.eclipse.jem.util 2.0.200.v200905140200)
    To: bundle com.ibm.icu [3.8.1.1,4.1.0)
    Cannot satisfy dependency:
    From: Java EMF Model Utilities 2.0.201.v201001252130 (org.eclipse.jem.util 2.0.201.v201001252130)
    To: bundle com.ibm.icu [3.8.1.1,4.1.0)
    Cannot satisfy dependency:
    From: Common Frameworks 1.1.300.v200904160730 (org.eclipse.wst.common.frameworks 1.1.300.v200904160730)
    To: bundle org.eclipse.jem.util [2.0.100,3.0.0)
    Cannot satisfy dependency:
    From: Validation Framework 1.2.102.v200905201610 (org.eclipse.wst.validation 1.2.102.v200905201610)
    To: bundle org.eclipse.wst.common.frameworks [1.1.200,2.0.0)
    Cannot satisfy dependency:
    From: Validation Framework 1.2.104.v200911120201 (org.eclipse.wst.validation 1.2.104.v200911120201)
    To: bundle org.eclipse.wst.common.frameworks [1.1.200,2.0.0)
    Cannot satisfy dependency:
    From: Eclipse XML Editors and Tools 1.1.1.v200908242115 (org.eclipse.wst.xml.ui 1.1.1.v200908242115)
    To: bundle org.eclipse.wst.validation [1.2.0,1.3.0)
    Cannot satisfy dependency:
    From: Eclipse XML Editors and Tools 1.1.2.v201001222130 (org.eclipse.wst.xml.ui 1.1.2.v201001222130)
    To: bundle org.eclipse.wst.validation [1.2.0,1.3.0)
    "

    Could you pls help us out?
    Thanks!
    Greetings from Hungary

    ReplyDelete
  18. Hi,

    I had the same issue. The problem was that I've installed much newer versions and not the ones mentioned in the tutorial:
    eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz instead of eclipse-SDK-3.5.1-linux-gtk-x86_64.tar.gz
    and
    android-sdk_r12-linux_x86.tgz instead of
    android-sdk_r04-linux_86.tgz....

    So. update sources for eclipse should be set for /indigo and not to /galileo:

    Indigo
    http://download.eclipse.org/releases/indigo/

    The next one for Android GTK still needed:

    Android SDK
    https://dl-ssl.google.com/android/eclipse/

    But DO NOT add the following because you already use 3.7 and not 3.5 (update source of 3.7 was already set during the install):

    The Eclipse Project Updates
    http://download.eclipse.org/eclipse/updates/3.5/

    ReplyDelete
  19. THANKS!

    The "indigo"-thing was missing at my installation and the solution was here!

    ReplyDelete
  20. I also got the below error ... it has to do with the version of Eclipse downloaded. The recommended version (Classic) does not actually seem to work with the plug-in. Try downloading the Java version of Eclipse with name "Eclipse IDE for Java Developers". This fixed that problem for me

    ReplyDelete

Note: Only a member of this blog may post a comment.