Java 无法在 Ubuntu 中安装 Android Studio

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28847151/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 06:56:00  来源:igfitidea点击:

Unable to install Android Studio in Ubuntu

javaandroidubuntuandroid-studio64-bit

提问by Carlos Carrizales

I'm using Ubuntu Gnome 14.04, and I have Java 8 installed (both the JDK and the JRE).

我使用的是 Ubuntu Gnome 14.04,并且安装了 Java 8(JDK 和 JRE)。

When I was installing Android Studio everything worked, but a message appeared saying:

当我安装 Android Studio 时,一切正常,但出现一条消息:

Unable to run mksdcard SDK tool

无法运行 mksdcard SDK 工具

How can I install Android Studio correctly, or how do I fix this ?

如何正确安装 Android Studio,或者如何解决此问题?

采纳答案by Rajesh

Presuming that you are running the 64bit Ubuntu, the fix suggested for "Issue 82711" should solve your problem.

假设您运行的是 64 位 Ubuntu,针对“问题82711”建议的修复程序应该可以解决您的问题。

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

Update: For Ubuntu 15.10 & 16.04 sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6

更新:对于 Ubuntu 15.10 和 16.04 sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6

回答by Sayem

@warsong is right. Installing only lib32stdc++6solved the problem.

@warsong 是对的。安装只lib32stdc++6解决了问题。

For next uses I rewrite @warsongs comment in answer area.

对于下一次使用,我会在答案区域重写 @warsongs 评论。

sudo apt-get install lib32stdc++6

Update :

更新 :

For Ubuntu 15.04,15.10,16.04 LTS & Debian 8

对于 Ubuntu 15.04、15.10、16.04 LTS 和 Debian 8

回答by sudoz

Checkout this page

结帐此页面

If you are running a 64-bit distribution on your development machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander) and above, install the libncurses5:i386, libstdc++6:i386, and zlib1g:i386packages using apt-get:

如果您在开发机器上运行 64 位发行版,则需要先安装其他软件包。为Ubuntu 13.10(莽撞蝾)及以上,安装libncurses5:i386libstdc++6:i386以及zlib1g:i386使用包apt-get

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

回答by drlolly

I understand the question is regarding UBUNTU, but I had similar problem in Debian Jessie 64bit and warsongs suggestion worked for it also.
When I ran studio.sh android studio would start, but when I tried to configure the android SDK I got the error
Unable to run mksdcard SDK tool
WHen I tried
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Got error
E: Package 'lib32bz2-1.0' has no installation candidate
So took warsongs suggestion and only tried to install lib32stdc++6.
sudo apt-get install lib32stdc++6
After this was able to add the Android SDK into Android Studio.

我知道这个问题是关于 UBUNTU 的,但我在 Debian Jessie 64bit 中遇到了类似的问题,warsongs 的建议也适用于它。
当我运行 studio.sh 时,android studio 会启动,但是当我尝试配置 android SDK 时出现错误,
Unable to run mksdcard SDK tool
当我尝试时
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
出现错误,
E: Package 'lib32bz2-1.0' has no installation candidate
因此采用了 warsongs 建议,只尝试安装 lib32stdc++6。
sudo apt-get install lib32stdc++6
之后就可以将 Android SDK 添加到 Android Studio 中。

回答by Bit-Man

For Linux Mint run

对于 Linux Mint 运行

sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6

回答by Timo B?hr

For Fedora (tested for Fedora 23/24) run

对于 Fedora(针对 Fedora 23/24 测试)运行

dnf install compat-libstdc++-296 compat-libstdc++-33 glibc libgcc nss-softokn-freebl libstdc++ ncurses-libs zlib-devel.i686 ncurses-devel.i686 ant

回答by Kyler Chin

The Problem is caused by mksdcard not being installed correctly.

问题是由 mksdcard 未正确安装引起的。

if you are running 64 bit, do this to fix the mksdcard problem.

如果您运行的是 64 位,请执行此操作以解决 mksdcard 问题。

    sudo dpkg --add-architecture amd64
    sudo apt-get update
    sudo apt-get install libncurses5:amd64 libstdc++6:amd64 zlib1g:amd64

and 32 bit:

和 32 位:

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

In SDK 6.0, the error message is different but means the same thing.

在 SDK 6.0 中,错误信息不同但含义相同。

    Unable to run mksdcard

回答by mjancola

None of these options worked for me on Ubuntu 12.10 (yeah, I need to upgrade). However, I found an easy solution. Download the source from here: https://github.com/miracle2k/android-platform_sdk/blob/master/emulator/mksdcard/mksdcard.c. Then simply compile with "gcc mksdcard.c -o mksdcard". Backup mksdcard in the SDK tools subfolder and replace with the newly compiled one. Android Studio will now be happy with your SDK.

这些选项都不适用于我在 Ubuntu 12.10 上(是的,我需要升级)。但是,我找到了一个简单的解决方案。从这里下载源代码:https: //github.com/miracle2k/android-platform_sdk/blob/master/emulator/mksdcard/mksdcard.c。然后简单地用“gcc mksdcard.c -o mksdcard”编译。在 SDK 工具子文件夹中备份 mksdcard 并替换为新编译的。Android Studio 现在会对您的 SDK 感到满意。

回答by anhnv

If you run sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6and got a message like: "The following packages have unmet dependencies: lib32stdc++6 : Depends: lib32gcc1 (>= 1:4.1.1)".

如果您运行sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0 lib32stdc++6并收到如下消息:“ The following packages have unmet dependencies: lib32stdc++6 : Depends: lib32gcc1 (>= 1:4.1.1)”。

You can do something like this tut: https://askubuntu.com/questions/671791/lib32stdc6-package-depends-on-gcc-base-but-my-installed-version-is-newer

你可以做这样的事情:https: //askubuntu.com/questions/671791/lib32stdc6-package-depends-on-gcc-base-but-my-installed-version-is-newer

回答by Selvaperumal

This issue arises when your 64 bit os tries to install the Android SDK which in turns tries to install some 32 bit binaries and thus is the issue of compatibility.

当您的 64 位操作系统尝试安装 Android SDK 时会出现此问题,而 Android SDK 又会尝试安装一些 32 位二进制文​​件,因此是兼容性问题。

Open an additional terminal and type

打开一个额外的终端并输入

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 

would help to install all the required binaries. After this, start the afresh the Android SDK installation process.

将有助于安装所有必需的二进制文件。之后,重新开始Android SDK安装过程。