使用现有项目打开Android Emulator



我需要用我现有的项目重新打开Android Emulator。当我按下按钮从主文件"运行"项目时,我得到以下错误:

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:Usersalbatcodehello_worldbuildappgeneratednot_namespaced_r_class_sourcesdebugrandroidx' 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

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

谢谢你的帮助。

从android工作室找到android AVD管理员。它将向您显示所有模拟器的列表。选择一个,然后单击"运行"。等待它启动,然后再次尝试运行您的应用程序。

如果这对你有用,请告诉我。

打开AVD管理器并选择您的模拟器。

如果您正在运行的应用程序显示任何错误。删除你以前不需要的应用程序。

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

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

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

最新更新