简体   繁体   English

无法在ubuntu的Android工作室中的模拟器中启动AVD

[英]Cannot launch AVD in emulator in Android studio in ubuntu

I am using Android Studio 2.1.2. 我使用的是Android Studio 2.1.2。 Operating system is Ubuntu 14. 操作系统是Ubuntu 14。

I created an emulator using the image arm. 我使用图像臂创建了一个模拟器。 When i started the emulator, I got the error as 当我启动模拟器时,我得到了错误

Cannot launch AVD in emulator. 无法在模拟器中启动AVD。

Output: 输出:

PANIC: HOME is defined but could not find Nexus_4_API_23.ini file in $HOME/.android/avd PANIC: HOME已定义但无法在$HOME/.android/avd找到Nexus_4_API_23.ini文件

(Note: avd is searched in the order of $ANDROID_AVD_HOME , $ANDROID_SDK_HOME/.android/avd and $HOME/.android/avd )". (注意:avd按$ANDROID_AVD_HOME$ANDROID_SDK_HOME/.android/avd$HOME/.android/avd )的顺序搜索。

I had this same issue in Xubuntu 16.04. 我在Xubuntu 16.04中遇到了同样的问题。 I initially installed as the root user which caused the issue. 我最初安装为导致该问题的root用户。

The Studio keeps looking for the avd path in your $HOME directory but it's actually in /root/.android/avd. Studio一直在$ HOME目录中查找avd路径,但实际上它位于/root/.android/avd中。 You CAN copy the avd folder to your home dir but you may run into permission issues. 您可以将avd文件夹复制到您的主目录,但您可能会遇到权限问题。

So I "reinstalled" under my current user which fixed it, these are the steps: 所以我在我当前修复它的用户下“重新安装”,这些步骤如下:

  • Delete the .android folder under ~/.android 删除〜/ .android下的.android文件夹

  • Move the unzipped android-studio folder to /usr/local/. 将解压缩的android-studio文件夹移动到/ usr / local /。

  • Add the /usr/local/android-studio/bin to the PATH variable. 将/ usr / local / android-studio / bin添加到PATH变量中。

  • To permanently save it add it to your .bash_profile (or ~/.profile) file as: 要永久保存,请将其添加到.bash_profile(或〜/ .profile)文件中,如下所示:

    export PATH=$PATH:/usr/local/android-studio/bin export PATH = $ PATH:/ usr / local / android-studio / bin

  • Now you can run it in the terminal as studio.sh 现在您可以在终端中将其作为studio.sh运行

  • Run studio.sh and re-configure Android Studio. 运行studio.sh并重新配置Android Studio。

  • Rebuild your virtual device and try running it again. 重建您的虚拟设备并尝试再次运行它。

That worked for me, hopefully it works for you. 这对我有用,希望它适合你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM