Android Studio - 启动模拟器 AVD - “无法定位 adb" [英] Android Studio - launch emulator AVD - "unable to locate adb"

查看:317
本文介绍了Android Studio - 启动模拟器 AVD - “无法定位 adb"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过 AVD 在 Android Studio 中启动模拟器时,它一直有这个烦人的弹出窗口无法定位 avd".

When I launch emulator in Android Studio through AVD, it keeps on having this annoying popup "unable to locate avd".

  • 我已经删除了平台工具,然后在 SDK Manager->SDK Tools->Android SDK platform-tools 下重新安装它,这样它就是一个新的 avd.exe,但它没有帮助.

我现在真的一无所知,我希望来自模拟器的 adb 打印进行调试.我该如何解决这个问题?

I am really clueless now how, I would like adb prints coming from the emulator to debug. How can I solve this ?

仅供参考,我正在 Android Studio 4.0 上开发 Flutter

FYI, I am developing flutter on Android Studio 4.0

推荐答案

我遇到了和你一样的问题,我研究了整个互联网,但没有发现任何有用的东西.所以,我以某种方式找出了问题并修复了它,问题出在

I had the same issue as you were facing, I have Researched the Whole Internet but found nothing useful. So, I somehow figured out the problem and fixed it, The problem is at

app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

每当我们由于某种原因创建一个新项目时,Module SDK 不会自动设置.因此,ADB 管理器抛出了一个错误无法定位 AVD",这并不是那么致命,因为错误/警告并没有阻止我们启动/启动模拟器,但是看到那个弹出框真是太烦人了.所以这是我简单快速的解决方法.

Whenever we create a new project due to some reason the Module SDK is not set up automatically. Thus the ADB manager was throwing an error 'Unable to locate AVD', which is not that fatal as the error/warning is not stopping us from launching /starting the emulator, but it is so annoying to see that pop-up box. So here is my simple and quick fix.

解决方案:

点击项目文件夹,点击旁边的下拉图标.

Click on the project folder, tap the dropdown icon just beside it.

现在导航到下面的路径.

Now Navigate to the path below.

>android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java

现在点击文件 GeneratedPluginRegistrant.java 将其打开.

Now Click on the file GeneratedPluginRegistrant.java to open it.

打开后,您会在顶部看到一个栏,上面写着Module SDK is not defined",

Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',

现在正对着它,您还将看到一个名为Setup SDK"的超文本,只需点击它.

Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.

这将打开一个标题为选择项目 SDK"的弹出框.

That will open a Pop-up Box with the title 'Select project SDK'.

现在选择 Android 平台 API,然后点击确定.完成后重新启动您的 IDE.

Now select the Android Platform API and then click OK. After that being done Restart your IDE.

您的问题将得到解决.您还会注意到 Emulator 的打开速度比以前更快.

Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.

注意:

每个新的 Flutter 项目都必须执行上述步骤.

我附上了一些屏幕截图,只需按照它们即可.

问题

下图表示您在启动我们将要修复的 AVD 时遇到的烦人的弹出框.

第一步:关闭AVD窗口

第 2 步:导航到 GeneratedPluginRegistrant.java

第 3 步:查找未定义的模块 SDK

第 4 步:针对模块 SDK 点击设置 SDK 超文本.

第 5 步:选择任意 Android SDK 版本

第 6 步:点击确定

第 7 步:重启 Android Studio IDE.

重新启动后,您将不再看到烦人的弹出框.

我还为您上传了 Youtube 视频.也检查一下.https://www.youtube.com/watch?v=19ESTnrmYJY&feature=youtu.be

I have also Uploaded a Youtube Video for you. Check that out as well. https://www.youtube.com/watch?v=19ESTnrmYJY&feature=youtu.be

这篇关于Android Studio - 启动模拟器 AVD - “无法定位 adb"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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