使用现有项目打开Android模拟器

时间:2020-04-28 17:16:26

标签: flutter

我需要使用现有项目重新打开Android模拟器。当我按下按钮从主文件“运行”项目时,出现以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Unable to delete directory 'C:\Users\albat\code\hello_world\build\app\generated\not_namespaced_r_class_sources\debug\r\androidx' after 10 attempts

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s

此外,它不是我一直使用的“ Pixel 2 API”设备,而是尝试使用“ sdk gphone x86”进行渲染。

谢谢您的帮助。

2 个答案:

答案 0 :(得分:0)

从android studio中找到android AVD管理器。它会向您显示所有模拟器的列表。 选择一个,然后单击运行。 等待它启动,然后尝试再次运行您的应用。

让我知道这是否适合您。

答案 1 :(得分:0)

打开AVD管理器,然后选择仿真器。

正在运行的应用程序显示任何错误。删除不必要的以前的应用程序。

然后再次运行并解决您当前的问题。

请检查您应用文件夹中的local.properties文件。如果此文件不存在,则创建local.properties并添加您的sdk链接

sdk.dir=/Users/<yourUserName>/Library/Android/sdk.