简体   繁体   English

Android Studio - 恐慌:无法打开AVD

[英]Android Studio - Panic: Could not open AVD

After many hours of fixing Gradle issues, I was able to build my test app in Android Studio. 经过几个小时的修复Gradle问题,我能够在Android Studio中构建我的测试应用程序。 But when I tried to run it in an AVD, it just won't open. 但是当我试图在AVD中运行它时,它就不会打开。

This is the log: 这是日志:

Waiting for device.
C:\Users\Rahaman\AppData\Local\Android\android-studio\sdk\tools\emulator.exe -avd testAVD -netspeed full -netdelay none

PANIC: Could not open: testAVD

PS: I've defined the environment variable ANDROID_SDK_HOME to point to the .android directory. PS:我已经将环境变量ANDROID_SDK_HOME定义为指向.android目录。

Okay, my libraries are in D: drive. 好的,我的库在D:驱动器中。 So I had to copy the .android folder from d:\\myName\\ to c:\\Users\\myName\\ . 所以我不得不将.android文件夹从d:\\myName\\复制到c:\\Users\\myName\\ That fixed it. 修好了。

You can use mklink (builtin of cmd.exe but NOT present in Powershell) to make a link like you would in linux. 您可以使用mklink (内置cmd.exe但不存在于Powershell中)来创建一个像在linux中一样的链接。 You must be an administrator to run the command, but once you do it will look like the directory is right there. 您必须是管理员才能运行该命令,但是一旦执行该命令,就会看起来该目录就在那里。

Run cmd.exe as an administrator. 以管理员身份运行cmd.exe。 Then in my case I issued the following: 然后在我的情况下,我发布了以下内容:

C:\Users\Dad>mklink /d .android E:\Joel\.android

Creating a regular windows shortcut (right click etc.) does not work. 创建常规Windows快捷方式(右键单击等)不起作用。

I got a slightly different solution working. 我有一个稍微不同的解决方案。 I created a symlink/shortcut from C:\\Users\\myName\\.android to D:\\Users\\myName\\.android (right-click, create shortcut) 我从C:\\Users\\myName\\.android创建了一个符号链接/快捷方式到D:\\Users\\myName\\.android (右键单击,创建快捷方式)

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

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