2

I downloaded android studio on Loki (up-to-date) and it works fine for the most part. However, when I try creating a virtual device and run I get error messages about missing files. This is most likely because I didn't install the necessary 32-bit libraries for my 64-bit system. According to the instrcutions on the android studio install page:

Required libraries for 64-bit machines:

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

When I run the given command, I get a message about a missing libgcc1:i386 which cannot be installed.

How can I get the relevant 32 bit libraries on Loki?


===EDIT===

I've enabled the i386 architecture with: dpkg --add-architecture i386 but that didn't help. Here's an output for the error messages for one of the packages:

The following packages have unmet dependencies:
libc6:i386 : Depends: libgcc1:i386 but it is not going to be installed
libstdc++6:i386 : Depends: libgcc1:i386 (>= 1:4.2) but it
is not going to be installed
E: Unable to correct problems, you have held broken packages.
1

Try just

sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386

Has worked flawlessly on many installs. Below is my full AS installation script if you needed more configuration, particularly KVM for hardware acceleration. The source is from my complete setup script on GitHub Gist

#!/bin/bash

cd ~
sudo apt update -qq
sudo apt upgrade

#enable ppa 

sudo apt install -yy software-properties-common python3-software-properties         
python-software-properties

sudo apt install -yy libc6:i386 libncurses5:i386 libstdc++6:i386

#install java JDK 8

sudo add-apt-repository ppa:webupd8team/java
sudo apt update -qq
sudo apt install -yy oracle-java8-installer
sudo apt install -yy oracle-java8-set-default

#install android studio

sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt update -qq
sudo apt install -yy android-studio

#set up KVM for android emulator hardware acceleration - change "username"   
to your systems username

sudo apt install -yy qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils    
virt-manager
sudo adduser username libvirtd 
sudo adduser username kvm

#trick to get emulator hardware acceleration to work properly

cd ~/Android/Sdk/tools/lib64/libstdc++
mv libstdc++.so.6 libstdc++.so.6.bak
ln -s /usr/lib64/libstdc++.so.6 ~/Android/Sdk/tools/lib64/libstdc++
sudo apt -qq update
sudo apt install -yy mesa-utils

#set home path

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
  • Running the first command you gave, I get the error: The following packages have unmet dependencies: libc6:i386 : Depends: libgcc1:i386 but it is not going to be installed libstdc++6:i386 : Depends: libgcc1:i386 (>= 1:4.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages. – ThisIsNotAnId Feb 23 '17 at 18:41
  • For the script you gave, I want to mention I just want to use the pre-built binaries downloaded from the android studio site. So I can keep my installation sandboxed as much as possible. I have an AMD-V capable CPU so I'm not sure if I need the packages to enable KVM support. Do you think I should install them all the same? – ThisIsNotAnId Feb 23 '17 at 18:43
  • I get a similar error for libncurses5:i386: libncurses5:i386 : Depends: libtinfo5:i386 (= 6.0+20160213-1ubuntu1) but it is not going to be installed Depends: libc6:i386 (>= 2.4) but it is not going to be installed Recommends: libgpm2:i386 but it is not going to be installed E: Unable to correct problems, you have held broken packages. – ThisIsNotAnId Feb 23 '17 at 18:46
  • If you are not going to be running the Android Emulator than there is no need to install KVM. So everything from the KVM install line down to the setting home path you can ignore. As far as the dependencies, I don't want to give bad advice on how to fix that, but I will refer you to -askubuntu.com/questions/263378/… - I hope that gets you going. Also, if you haven't make sure you do a system update :) – Sean Patterson Feb 23 '17 at 18:56

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.