SDK 工具更新到 25.3.1 后,Android Studio 上的模拟器无法启动 [英] Emulator on Android Studio doesn't start after SDK tools update to 25.3.1

查看:27
本文介绍了SDK 工具更新到 25.3.1 后,Android Studio 上的模拟器无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天将我的 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,您可以获得更多信息.我尝试重新安装系统映像(例如带 Google API 的 Android API 25 x86)、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(Android API 25 x86,带 Google API)
来源:/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.

更新:找出配置问题!

我注意到我定期看到控制台错误您的模拟器已过期,请通过启动 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/模拟器.$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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆