Problem launching android AVM/SDK gui using the tools/android executable in the android SDK. Ubuntu 10.04, i686
Asked Answered
M

8

11

Hi I just installed the android SDK along with Eclipse 3.5 on my i686 Thinkpad T60 running Ubuntu 10.04 (Lucid). (Eclipse was installed via synaptic, i.e. a package from the repository.) I installed the eclipse add on and everything on the Eclipse end seems fine. I also put the android-sdk tools directory on my user PATH. Now launching tools/android without any arguments is supposed to bring up the SDK and AVD manager GUI, but instead I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-gtk-3550 or swt-gtk in swt.library.path, java.library.path or the jar file
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
    at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
    at com.android.sdkmanager.Main.showMainWindow(Main.java:265)
    at com.android.sdkmanager.Main.doAction(Main.java:249)
    at com.android.sdkmanager.Main.run(Main.java:94)
    at com.android.sdkmanager.Main.main(Main.java:83)

The strange thing is I definitely have all the prerequisites installed, sun-java6-jdk, and open-java6-jdk and have tried switching between them. Also if I look in synaptic I have libswt-gtk-3.5java installed. Also he AVM/SDK manager launches fine when I launch it with eclipse.

(You may wonder why i care, but I like working from the command line, and considering using emacs as my IDE rather than Eclipse.)

If anyone knows how i can fix this please let me know.

Moeller answered 27/7, 2010 at 14:56 Comment(1)
Hey - mark Bart's answer as accepted! :) It works.Fluid
I
44

(copied from Ubuntuforums http://ubuntuforums.org/showthread.php?t=1540054)

I had the same issue 12 months on. I discovered that it was because I had made the /tmp directory "noexec" as soon as I made it executable, we were fine.

sudo mount -o remount,exec /tmp

Hope this helps someone.

Illogic answered 29/8, 2011 at 6:44 Comment(5)
Thanks that helped me! took me some time to get to your answerSoldierly
Wowza. That is the magic Harry Potter spell. This got DDMS to run from the command line (not thru eclipse) on my Kubuntu 11.10 AMD64 install. Thank you.Urian
right there! another reason to hate java even harder than before... it tries to execute /tmp/swtlib-32/libswt-gtk-3550.so go figure... so if you really need RO /tmp (and you should) just symlink this dir to another place...Sha
I don't remember ever doing this. I think it might be the default on linux mint.Candiscandle
Yeah, Ubuntu never gave me this problem - only Linux Mint. I hope the asker marks your answer as accepted someday!Fluid
A
4

Additionally to what the user Bart well and correctly said I suggest to pay attention into the tip bellow:

Advanced linux users or geeks more often will face this issue. A "tweak" (usually to get more speed) applied in /etc/fstab making /tmp as noexec will cause this problem. Just open fstab and modify the entry as follow bellow:

sudo gedit /etc/fstab

If you have something like this just comment the line or modify the content:

tmpfs /tmp tmpfs defaults,noexec,nodev,nosuid 0 0

TO:

tmpfs /tmp tmpfs defaults,nodev,nosuid 0 0

Audy answered 9/1, 2013 at 1:26 Comment(0)
G
3

Have a look at

android <command> --no-ui

This doesn't require SWT/GTK at all.

Gerenuk answered 15/2, 2011 at 10:45 Comment(0)
V
2

This is an old question, but I want to propose a less 'drastic' answer...

If you don't want to change your file-system mount, an alternative is that you can change the android tools startup script to explicitly specify the temporary directory that Java should use.

e.g. in the android-studio/sdk/tools directory, right at the end of the android script file is the command that executes java:

exec "$java_cmd" \
    -Djava.io.tmpdir=/home/me/android-studio/.tmp \
    -Xmx256M $os_opts $java_debug \
    -Dcom.android.sdkmanager.toolsdir="$progdir" \
    -classpath "$jarpath:$swtpath/swt.jar" \
    com.android.sdkmanager.Main "$@"

In this example I use "/home/me/android-studio/.tmp" but of course you change that to whatever you want.

Unfortunately this change will get overwritten if you update your Android tools so you would have to reapply it each time you update. You could instead export it in your profile as a global environment property (for all Java applications) instead of editing this script.

Valse answered 28/10, 2014 at 19:21 Comment(0)
A
1

i also got this problem. I solved it by changing the ownership of the android sdk home directory (that i installed in '/opt') to me. This was done with something like:

sudo chown -R <username> /opt/android-sdk-linux 

And it worked fine !

Asshur answered 9/8, 2013 at 12:57 Comment(0)
S
0

just a better way to show the code.. consider this a comment from @Bart answer...

for some reason it tries to exec swt-lib from /tmp. that's wrong and dumb and i have no idea who's the culprit here (android or the java lib itself)

so, if you don't want to remount /tmp as RW, just symlink that swtlib dir to some place else. i moved it to the android dir.

(0) ~
hobo$ mv /tmp/swtlib-32 android/

(0) ~
hobo$ ln -sf ~/android/swtlib-32 /tmp/swtlib-32

(0) ~
hobo$ android/android-sdk-linux/tools/android 
Sha answered 9/11, 2012 at 2:16 Comment(0)
B
0

Just delete contents of tmp dir.

sudo rm -rf /tmp/*

Try to launch android sdk manager afterwards. It worked for me.

Byrn answered 17/2, 2016 at 9:29 Comment(0)
P
0

If you want to launch sdk-manager via commandline, another option is, try running:

> sudo android sdk

This would run in admin mode giving you required permissions

Polyphonic answered 18/8, 2017 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.