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

查看:1041
本文介绍了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

推荐答案

我遇到的问题与您面临的问题相同,我已经研究了整个Internet,但没有发现有用的东西.所以,我以某种方式找出了问题并加以解决,问题出在

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.因此,亚行经理抛出了一个错误无法找到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.

打开后,在顶部,您会注意到一个栏,显示"未定义模块SDK ",

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.

您的问题将得到解决.而且您还将注意到,模拟器的打开速度比以前更快.

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

注意:

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

希望这对您有所帮助.如果是的话,请Upvote .

我附上了一些截图,只是关注它们.

问题

下面的图像代表您在启动要修复的AVD时遇到的烦人的弹出框.

步骤1:关闭AVD窗口

步骤2:导航至GeneratedPluginRegistrant.java

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

第4步:针对Module SDK,单击Setup 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天全站免登陆