1

I have been trying to install android studio or just the android sdk tools on Ubuntu 16.04 64 bit for the past two days.

I follow the directions exactly as on the android developer page but cannot get past the android studio intellij splash screen. The small yellow-green bar loads at the bottom, the splash screen disappears, and then nothing ever loads. I quit the program and try and reload it but only the android studio icon shows up on my bar but no IDE and I never get to see the welcome/setup screen.

I then tried to install just the sdk tools and the sdk manager shows up once (during the initial loading of the packages) but when I close it because it asks to be closed , it fails to show up again and does the same as Android Studio did: just the icon for the sdk manager shows up but no actual manager is displayed.

I tried running using sudo and gksudo and no luck. I tried switching the java version from the openjdk one to the official oracle one, and still nothing. Don't know what else to do. I don't get any error messages just warnings but I checked the warnings (on this site) and they are warnings that don't hinder the IDE or tools from running. Same warnings show up on the windows side and the IDE runs fine, too. Help is greatly appreciated. I will continue to find a solution as well. Thank you.

Edit: I'm on the latest java 8 jdk version.

EDit2: added new warnings after checking path var. THese are warnings without sudo. NO warnings show up with sudo/gksudo.

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Looking in classpath from com.intellij.util.lang.UrlClassLoader@6d5380c2 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/usr/local/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /home/fractal/.AndroidStudio2.2/system/tmp/jna5354933404535168276.tmp
Found jnidispatch at /home/fractal/.AndroidStudio2.2/system/tmp/jna5354933404535168276.tmp
[   2786]   WARN - s.RepoProgressIndicatorAdapter - File /home/fractal/.android/repositories.cfg could not be loaded. 
[   3304]   WARN - s.RepoProgressIndicatorAdapter - java.io.FileNotFoundException: /tmp/StudioDownloader1sys-img2-1.xml (No such file or directory) 
[   3429]   WARN - s.RepoProgressIndicatorAdapter - java.io.FileNotFoundException: /tmp/StudioDownloadersys-img2-1.xml (No such file or directory) 
[   4442]   WARN - dea.updater.SdkComponentSource - File /home/fractal/.android/repositories.cfg could not be loaded.

This is what shows up with sudo ./studio.sh:

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Looking in classpath from com.intellij.util.lang.UrlClassLoader@6d5380c2 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/usr/local/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /root/.AndroidStudio2.2/system/tmp/jna2426221977068908893.tmp
Found jnidispatch at /root/.AndroidStudio2.2/system/tmp/jna2426221977068908893.tmp

Edit3: new warning after modifying ~/.bashrc

[   4348]   WARN - s.RepoProgressIndicatorAdapter - java.io.FileNotFoundException: /tmp/StudioDownloader1addon2-1.xml (No such file or directory)

Update with fix

Personal space issues were fixed following the commands below. The ultimate fix, however, was a bit silly. I had my vr headset plugged and the setup screen appeared on the headset. I just turned off the display and was able to properly configure android studio. Thanks for helping me in this silly endeavor.

  • Is you java home environment variable in your path, is it set in .bashrc, and what are these warnings ? – George Udosen Feb 12 '17 at 8:28
  • @George I don't see it there but I have placed it in /etc/environment Edit: checking warnings now. – Fractal Feb 12 '17 at 8:42
  • What messages were you receiving, and was it set like this JAVA_HOME="/usr/lib/jvm/java-8-oracle"? – George Udosen Feb 12 '17 at 8:47
  • @George added warnings and yes that is what I have along with export JAVA_HOME – Fractal Feb 12 '17 at 8:58
  • You don't need export if placed in /etc/environemnt file. – George Udosen Feb 12 '17 at 9:06
0

Ensure you have downloaded Android Studio from the official site.

Android Studio doesn't have to be installed per se. It is a self contacted package in a zip file that can be run, just by opening the package and running the start file which is named studio.sh and is located in the bin directory of the package.

Looking at the output of your question, you are running some of the commands as root which is causing problems with some of the file and execute permissions of your personal space. The application uses your personal space for some of the persistence configuration between sessions.

You can verify this (files not owned by you) by running this command:

$ find ~/ -mount ! -user $(whoami)

If it shows any output, the output is problematic. It's showing files in your personal space that is not owned by you.

You can fix this by running:

$ sudo chown -R $(whoami):$(whoami) ~/

Now go to where you opened the zip package and find the studio.sh file and run it with this command:

$ ./studio.sh

The package can be unzipped anywhere on your computer. To make it convenient to run it from the commandline without having to locate and change to the directory where you opened it, you can make a link to it in your execute path with:

$ [[ -d ~/bin ]] && mkdir ~/bin
$ ln -s [full path of studio.sh] ~/bin/studio.sh

If you find your studio.sh file in ~/android-studio/bin the command to add it to your search path would be:

$ ln -s ~/android-studio/bin/studio.sh ~/bin/studio.sh

As far as install go, you can conveniently place the ~/android-studio folder in your /opt/ folder to make it available for other users. Then the link command would be:

$ ln -s /opt/android-studio/bin/studio.sh ~/bin/studio.sh

Summary
The problem you are having is that you are making unintended changes to your personal space by running applications as sudo. The resolution is to give proper permissions back to your account and run the commands as your own access. Use sudo only when you are intentionally making changes to the whole system. You would also use sudo if you were going to move the zip folder from your personal space to a different space in the system. But when you actually run a program for usage, never use sudo. If you have a program meant for regular users that are not for IT maintenance and it doesn't work without sudo that may mean the application or your personal space if broken and the issue should be corrected.

Update:

Verify the jdk installation. While either will work, this is an alternative installation:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Final resolve

The issue was resolved (in chat) by recognizing the GUI was being output to a third monitor which was not currently in view.

Create the launcher:

$ sudo apt install gnome-panel
$ gnome-desktop-item-edit --create-new ~/Desktop

For the new launcher use:

Type       Application
Name       Android Studio
Command    (Click the browse button and browse to the `studio.sh` script.)
Commen     Android Development IDE

Click OK

Now copy or move the new launcher from your ~/Desktop to ~/.local/share/applicatons/

Now you can launch Android Studio from the Ubuntu Dash Search button.

  • I learned this recently and I followed the direction for installing oracle's java from here: digitalocean.com/community/tutorials/… – Fractal Feb 12 '17 at 23:58
  • Run the java install (which is a packaged PPA to install the complete JDK from Oracle) to ensure you have all the necessarily components. At a glace it appears that you only have the runtime installed. You also need the java compiler installed. – L. D. James Feb 13 '17 at 0:05
  • Comments are not for extended discussion; this conversation has been moved to chat. – Seth Feb 13 '17 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.