SDK工具更新至25.3.1后,Android Studio上的模拟器无法启动 [英] Emulator on Android Studio doesn't start after SDK tools update to 25.3.1
问题描述
今天将我的Android SDK工具更新为25.3.1之后,模拟器将不再运行.
After updating my Android SDK tools today to 25.3.1, the emulator won't run anymore.
我可以打开AVD管理器.当我在列表中的一个模拟器上点击播放"时,我在Android Studio上看到下面的栏
I can open the AVD Manager. When I hit "Play" on one of the emulators on the list, I see the bar below on Android Studio
但是在进度条到达终点之后,什么也没发生.
But then after the progress bar reaches the end, nothing happens.
我在发行说明中看到最新的更新给仿真器带来了变化,所以我想知道这是一个错误还是我缺少有关此的东西.
I see in the release notes that the latest update brought changes to the emulator so I'm wondering if that's a bug or I'm missing something about that.
我正在使用Android Studio 2.3.
I'm using Android Studio 2.3.
有什么想法吗?
推荐答案
升级后,我遇到了同样的问题.我不知道是什么原因导致了配置问题,但确实找到了解决方法.
I ran into the same problem after upgrading. I can't figure out what's causing the configuration problem but I did figure out a workaround.
首先,我尝试从命令行启动仿真器:
First, I tried to launch the emulator from the command line:
$ emulator @<name_avd_image>
emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-ranchu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is defined (<android>/sdk) but cannot find kernel file in <android>/sdk/system-images/ sub directories
如果使用-verbose
标志运行emulator
,则可以获得更多信息.我尝试重新安装系统映像(例如Android API 25 x86 w/Google API),Android Emulator 25.3.1,并重新创建AVD,但没有任何效果.
You can get more information if you run emulator
with the -verbose
flag. I tried re-installing the system image (e.g. Android API 25 x86 w/ Google APIs), Android Emulator 25.3.1, and re-creating the AVD but nothing worked.
最后,我只是将所有系统文件从SDK系统映像目录复制到了AVD目录中:
Finally as a workaround, I just copied all of the system files from the SDK system images directory into the AVD directory:
示例:Pixel XL(带有Google API的Android API 25 x86)
来源:<android>
/sdk/system-images/android-25/google_apis/x86/
目的地:〜/.android/avd/Pixel_XL_API_25.avd/
Example: Pixel XL (Android API 25 x86 w/ Google APIs)
SOURCE: <android>
/sdk/system-images/android-25/google_apis/x86/
DESTINATION: ~/.android/avd/Pixel_XL_API_25.avd/
此后,模拟器立即启动.这不是很理想,但是这阻碍了我的开发,因此我不得不重新启动模拟器并重新运行它.我希望其他人能够弄清楚配置中发生了什么.
After that the emulator started right up. It's not ideal, but this was blocking my development so I had to get the emulator up and running again. I hope someone else will be able to figure out what broke in the configuration.
更新:解决了配置问题!
UPDATE: Figured out the configuration problem!
我注意到我经常看到控制台错误您的模拟器已过时,请通过启动Android Studio进行更新:",所以我决定检查:
I noticed I periodically was seeing the console error "Your emulator is out of date, please update by launching Android Studio:" so I decided to check:
$ which emulator
<$ANDROID_SDK_ROOT>/tools/emulator
在此线程的帮助下:
问题在于有两个仿真器:其中一个
$ANDROID_SDK_ROOT/tools
,另外一个$ANDROID_SDK_ROOT/emulator
.$ANDROID_SDK_ROOT/tools
中的一个 无法启动.将$ANDROID_SDK_ROOT/emulator
放在之前$ANDROID_SDK_ROOT/tools
在您的$PATH
变量中,它应该修复 问题.
The problem is there are two emulators: one in
$ANDROID_SDK_ROOT/tools
, another one in$ANDROID_SDK_ROOT/emulator
. The one in$ANDROID_SDK_ROOT/tools
cannot start. Place$ANDROID_SDK_ROOT/emulator
before$ANDROID_SDK_ROOT/tools
in your$PATH
variable, it should fix the problem.
注意:对于大多数Mac用户,您可以编辑~/.bash_profile
来更改这些设置,然后运行$source ~/.bash_profile
来加载更新.在我的特殊情况下,我还必须清除$ ANDROID_HOME的旧值.
NOTE: For most Mac users, you can edit your ~/.bash_profile
to change these settings and then run $source ~/.bash_profile
to load the updates. In my particular case, I also had old values for $ANDROID_HOME that I had to clear out.
这篇关于SDK工具更新至25.3.1后,Android Studio上的模拟器无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!