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

梦想与她 提交于 2019-11-30 12:44:19

(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.

Erick Will

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

Have a look at

android <command> --no-ui

This doesn't require SWT/GTK at all.

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.

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 !

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 

Just delete contents of tmp dir.

sudo rm -rf /tmp/*

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!