Android Studio, problem updating the app & creating the AVD

You have a problem with Salix? Post here and we'll do what we can to help.
User avatar
Themis
Posts: 72
Joined: 27. Feb 2016, 22:17
Location: France

Android Studio, problem updating the app & creating the AVD

Post by Themis »

Hello,

For school assignment purposes, I have to work with Android Studio. I installed it preferably with the AS archive provided on the official website. I guess I’ve installed the required dependencies, the AS installation was OK (same for the SDK), but I encounter an error when trying to create the AVD.
Here is what idea.log tells me.

Code: Select all

2017-11-08 19:36:53,230 [6479300]   WARN - vdmanager.AvdManagerConnection - Failed to create the SD card. 
2017-11-08 19:36:53,231 [6479301]   WARN - vdmanager.AvdManagerConnection - Failed to create sdcard in the AVD folder. 
So I tried to relaunch the app (just in case), which then asked me to update it. Couldn’t do it without the superuser permissions, so I did this (and the app is launched, right now):

Code: Select all

sudo /usr/local/android-studio/bin/studio.sh
Password: 
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.3/system/tmp/jna2966690450378067686.tmp
Found jnidispatch at /root/.AndroidStudio2.3/system/tmp/jna2966690450378067686.tmp
Nov 09, 2017 12:07:51 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Nov 09, 2017 12:07:51 PM java.util.prefs.FileSystemPreferences$6 run
WARNING: Prefs file removed in background /root/.java/.userPrefs/prefs.xml
[   5135]   WARN - dea.updater.SdkComponentSource - File /root/.android/repositories.cfg could not be loaded. 
[   5509]   WARN - s.RepoProgressIndicatorAdapter - File /root/.android/repositories.cfg could not be loaded. 
[   8896]   WARN - dea.updater.SdkComponentSource - java.io.FileNotFoundException: /tmp/StudioDownloadersys-img2-1.xml (No such file or directory) 
Updater: uses bundled java.
Updater: java: /usr/local/android-studio/jre/jre copied to /root/.AndroidStudio2.3/system/restart/jre
Looking in classpath from sun.misc.Launcher$AppClassLoader@15db9742 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 /tmp/jna-3506402/jna6660961181595254522.tmp
Found jnidispatch at /tmp/jna-3506402/jna6660961181595254522.tmp
Looking in classpath from sun.misc.Launcher$AppClassLoader@70dea4e for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/tmp/jetbrains.patch.jar.androidstudio_copy_root!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /tmp/jna-3506402/jna6066763618701288308.tmp
Found jnidispatch at /tmp/jna-3506402/jna6066763618701288308.tmp
Looking for library 'Rstrtmgr'
Adding paths from jna.library.path: null
Trying libRstrtmgr.so
Adding system paths: [/usr/lib64, /lib64, /usr/lib, /lib]
Trying libRstrtmgr.so
Looking for version variants
Looking in classpath from sun.misc.Launcher$AppClassLoader@70dea4e for Rstrtmgr
I did this because that’s where AS is installed. I updated it, but for an unknown reason it seems like it has installed a second AS (3.0, this time), apparently in /root… That I don’t understand why.

So, first of all, is there a way to safely remove the recent installation? Maybe I should also remove the 2.3.3 version, too, and restart from scratch? I thought that the original problem might be a lack of dependencies, even though I thought I had installed what was needed, but I may have missed something. Right now, what I worry about is this AS 3.0 installed in /root, where it should not be.
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Android Studio, problem updating the app & creating the

Post by gapan »

I have never used android studio and I haven't checked, but I'm guessing the version provided by SBo (and therefore our slapt-src/spi/sourcery tools) is a bit old. That's probably why you got the update notification. The proper way to upgrade any package, would be to create a package for the newer version, but you then used sudo to run and update it through its own, internal to android-studio, system. That way, you have overridden package management. Starting it with sudo, also means that you started it as the root user, that's why you got those things installed in /root, which is the root user's homedir.

If the upgrade completed, package management has no idea what files it added or upgraded, so in order to remove those you'll probably need to do some searching in your hard drive. It's probably all contained in a single directory, where the package put the bulk of its files, but maybe not...

I'm also guessing the problems you had were because android studio requires a multilib system. There may be problems or missing functionality if you run it in a pure 32bit or pure 64bit system.

For software like this, which is provided as a huge binary bundle from the original developer, it might be a better idea to download that instead and install it somewhere in your home directory or in /opt. That way you could probably use its auto update features without package management getting in the way. The SlackBuild most probably just repackages that into a Slackware package anyway.
Image
Image
User avatar
Themis
Posts: 72
Joined: 27. Feb 2016, 22:17
Location: France

Re: Android Studio, problem updating the app & creating the

Post by Themis »

Thank you, gapan.

Here are the info I can get.

Code: Select all

$ sudo ls -la /root
Password: 
total 40
drwx------ 12 root root  322 Nov  9 12:16 .
drwxr-xr-x 21 root root  224 Nov  9 12:00 ..
drwxr-xr-x  4 root root   34 Nov  9 12:07 .AndroidStudio2.3
drwxr-xr-x  4 root root   34 Nov  9 12:16 .AndroidStudio3.0
-rw-r--r--  1 root root  149 May 29  2011 .Xresources
drwxr-xr-x  2 root root   32 Nov  9 12:18 .android
-rw-------  1 root root  178 Oct 20 21:16 .bash_history
-rw-r--r--  1 root root   79 Jun 16  2009 .bashrc
drwx------  4 root root   35 Oct 18 19:23 .config
drwx------  3 root root   25 Oct 18 21:37 .dbus
-rw-r--r--  1 root root  671 Sep  3  2009 .elvisrc
drwx------  2 root root   41 Oct 18 15:47 .gnupg
-rw-r--r--  1 root root  104 Aug 14  2012 .gtkrc-2.0
drwxr-xr-x  4 root root   37 Nov  9 12:07 .java
drwxr-xr-x  2 root root   24 Oct 18 12:58 .kbd
-rw-r--r--  1 root root 7650 Sep  3  2009 .nanorc
-rw-r--r--  1 root root  163 May 30  2009 .screenrc
drwx-----T  3 root root   23 Oct 22 16:52 .texlive2016
drwxr-xr-x  3 root root   20 Oct 17 14:56 .vim
-rw-r--r--  1 root root  621 Sep 28  2011 .vimrc
-rwxr-xr-x  1 root root 2610 Aug 14  2012 .xinitrc
I don’t even know why there are AS 2.3 stuff in there, but anyway. I’ve found this thread, for a similar installation problem, and someone says that /root is not supposed to contain important things. So apparently I should be able to remove the AS directories without damaging anything?

Also, for what I remember, I installed AS with the official archive. That’s why I don’t really understand why it causes me those sort of trouble.
Should I try this…

Code: Select all

$ sudo rm -R .android .AndroidStudio*
… and then try to install it again (with the official .zip archive)?
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Android Studio, problem updating the app & creating the

Post by gapan »

Yes, you should be fine with removing those directories in /root (in fact, you should). Re-reading your first post, I realise you didn't use the SlackBuild, but the official bundle. Did you install version 2.3 by accident though? You should be fine with installing the latest version, which is 3.0. But do you have a multilib system?

You can also remove the other directories in your homedir if you have no actual work in there yet.
Image
Image
User avatar
Themis
Posts: 72
Joined: 27. Feb 2016, 22:17
Location: France

Re: Android Studio, problem updating the app & creating the

Post by Themis »

(I answer your questions before removing/reinstalling anything.)

I had installed AS 2.3 because this was the latest version when I got it, back on October, 20th. I don’t remember everything I did, but I guess I had followed the official instructions, but it is possible that I had not found some dependencies (not sure, though… :? ). I had created a /home/Android/ directory for the software, and thought it would install everything in it (or mostly). Apparently, it had not…
Today, because of the initial problem (AVD one), I restart the software, which then asked me to update. That’s where the actual “/root and all” problems began.

I may not have a multilib system. To be honest, I don’t know, and I don’t know how to check that either on a slackware-like OS. A quick search made me read this: https://docs.slackware.com/slackware:multilib
Is it what I should follow, or does Salix have something of its own?
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: Android Studio, problem updating the app & creating the

Post by gapan »

From your output it seems that it got installed in /usr/local/android-studio, not in /home/Android.

If you don't know wether you have multilib installed, you don't. It's the same as in slackware. djemos created a script to make it easier to install it. It should still work:
viewtopic.php?f=20&t=4910&p=31878#p31878

If I had a choice I would steer clear of multilib though, it's a mess. But I don't know what functionality in android-studio would break without it.
Image
Image
User avatar
Themis
Posts: 72
Joined: 27. Feb 2016, 22:17
Location: France

Re: Android Studio, problem updating the app & creating the

Post by Themis »

Thank you.
Just to kind of log what I’ve done:

Code: Select all

[~]$ sudo rm -R /root/.android
[~]$ sudo rm -R /root/.AndroidStudio3.0/
[~]$ sudo rm -R /root/.AndroidStudio2.3/
[~]$ rm -R .AndroidStudio2.3/
[~]$ rm -R .android/
[~]$ rm -R Android
I guess I removed everything since there’s nothing even in /opt.

About the multilib, if you say it’s a mess, I’m totally willing to avoid it. It’s just that I’ve read it’s kind of required for AS, which annoys me. If it runs my nerves, I would consider doing this school assignment on Windows. I’m not found of IDE (though they have their pros), but end up forced to use some of them for my studies… It’s just always painful to have them work properly on a Linux distro. I’d rather use some text editor and CLI compilers, but well…
User avatar
ChuangTzu
Donor
Posts: 388
Joined: 19. May 2015, 23:34

Re: Android Studio, problem updating the app & creating the

Post by ChuangTzu »

Just a thought, what about a chroot or VM with multilib just to run that program. That way the main OS stays "clean".
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Android Studio, problem updating the app & creating the

Post by mimosa »

Or you could probably do this (assuming it is not multilib as such that is needed, but a 32-bit environment):

viewtopic.php?f=20&t=150&p=40113&hilit=schroot#p40113
User avatar
Themis
Posts: 72
Joined: 27. Feb 2016, 22:17
Location: France

AS

Post by Themis »

I was considering using a VM, but this laptop is not brand new and is not meant to handle too much things at a time. Otherwise that’s probably what I would have done. :)

As for your suggestion, mimosa, thank you. Problem is: I’m running a 64-bit environment. That’s why I was wondering whether I should make it multilib. Would that be that bad? A friend of mine (using Arch) told me that was fine, but maybe it’s different here, I don’t know.
I can’t figure out what is missing, actually. The only problem was this AVD thing… I’ll try to install AS again tomorrow, just in case this time it would be nice…
Post Reply