LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2011, 02:36 PM   #1
Geet
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Rep: Reputation: Disabled
Talking Trying to install Androd SDK but I get "Failed to create directory android_sdk_/temp"


Hey everyone,

I'm a linux newbie and I'm running into problems when I'm trying to set up Android development environment on my computer. Long story short, I wanna know how to run eclipse as root without doing it through command prompt (when I do it through command prompt, I get an error - see below). But in case you wanna hear the long story, here it is (please be warned that the story is from a long time Windows user's frame of reference) :

I've downloaded the Android SDK, and now I'm trying to get the other packages that comes with the SDK with the Android SDK and AVD Manager. When trying to install a particular package, I get "Failed to create directory android-sdk-linux_x86/temp". I assumed this was because I was running "./android" as a user and not as root. So I logged in as su at the command prompt and tried running "./android" there. It then throws the following exception:

Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
No protocol specified
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
at org.eclipse.swt.widgets.Display.create(Unknown Source)
at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.getDefault(Unknown Source)
at org.eclipse.swt.widgets.Shell.<init>(Unknown Source)
at org.eclipse.swt.widgets.Shell.<init>(Unknown Source)
at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.createContents(UpdaterWindowImpl.java:118 )
at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.open(UpdaterWindowImpl.java:98)
at com.android.sdkuilib.repository.UpdaterWindow.open(UpdaterWindow.java:98)
at com.android.sdkmanager.Main.showMainWindow(Main.java:312)
at com.android.sdkmanager.Main.doAction(Main.java:281)
at com.android.sdkmanager.Main.run(Main.java:99)
at com.android.sdkmanager.Main.main(Main.java:88)

So I'm guessing I should run the Android SDK and AVD Manager (./android) through eclipse. So here's my question:
I'm able to run eclipse as user (in which case Android SDK and AVD Manager gives the same error that it can't create the temp dir), but how do I run eclipse as root? When I try running eclipse as su from the command prompt, I get this error:


android-sdk-linux_x86/tools# eclipse
No protocol specified

(eclipse:13082): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(eclipse:13082): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(eclipse:13082): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:13082): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_display_get_pointer: assertion `GDK_IS_DISPLAY (display)' failed

(eclipse:13082): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_n_monitors: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion `GDK_IS_COLORMAP (colormap)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:13082): Gdk-CRITICAL **: gdk_window_new: assertion `GDK_IS_WINDOW (parent)' failed
Segmentation fault


I downloaded eclipse through apt. I'm unable to find the install directory. Where did apt download eclipse???

I'm not even sure if I'm on the right track, so any help would be greatly appreciated.

Thanks in advance!
Geet

Last edited by Geet; 06-20-2011 at 02:50 PM.
 
Old 06-20-2011, 08:55 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Unfortunately, you are not on the right track.

None of the Android SDK tools require Eclipse, so the problem isn't that you are running them stand alone. Furthermore, Eclipse should absolutely not be running as root, nor should any other GUI application for that matter. This has unexpected results in modern systems, as you are seeing here. In fact, both errors you are seeing are likely due to the fact it is trying to run GUI applications via root while X is running as a user.

The only issue you really have here is the "Failed to create directory" one. Where are you trying to extract the SDK to? It should be going under /home somewhere, anywhere else (like /opt or /usr) would cause a permissions error when trying to create a new directory.
 
Old 06-21-2011, 04:35 AM   #3
Geet
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks MS3. My android installation is in Home/Downloads, so I'm not sure why it can't create the temp dir there. Has anyone else run into this problem or am I overlooking something? I'll try downloading the sdk again I guess.
 
Old 06-23-2011, 06:33 AM   #4
Geet
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thumbs up I deleted my extracted folder and re-extracted the sdk tgz file once again and it worked!

I downloaded the sdk tgz file once more and extracted it and it worked just fine. Just to make sure, I went back to the first sdk tgz file I downloaded a few days back and extracted it once more as well - and that worked as well. So I'm thinking maybe it wasn't extracted right the first time I did it :-/ Anyway,m it's working now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
best to install /temp on my raid0 "partition" for video editing; space limit. for /? streams &dragonflies Ubuntu 0 10-18-2008 08:53 PM
best to install /temp on my raid0 "partition" for video editing; space limit. for /? streams &dragonflies Linux - Software 0 10-17-2008 02:49 AM
FC1 rhythmbox error : "Failed to create mad element; Check your installation." marco75 Fedora 4 03-03-2005 04:28 PM
"wine: failed to create the process heap", in Fedora Core 2 crimsonmoon Linux - Software 3 06-16-2004 05:59 AM
does failed using urpmi messed up my "Install Software" / "mandrake update" ??? sirpelidor Mandriva 1 11-02-2003 10:00 PM


All times are GMT -5. The time now is 06:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration