首页 > 解决方案 > 在 Android Studio 中运行 Flutter App 时出现错误:任务 ':app:generateDebugBuildConfig' 执行失败

问题描述

我是移动应用程序开发的新手,但我想构建一个非常简单的应用程序。我在网上搜索,发现 Flutter 是最吸引人的选择。我找到了一些视频,向您展示了如何使用 Android Studio 设置 Flutter。我跟着视频,一切都很好,直到我在模拟器上运行 Flutter 模板时遇到问题。我收到了这个错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
> java.nio.file.AccessDeniedException: C:\Users\ivomu\Desktop\New folder\PROGRAMIRANJE\Flutter Apps\WeightAppp\build\app\generated\source\buildConfig\debug\com\example\WeightAppp

* 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 3s
Exception: Gradle task assembleDebug failed with exit code 1

我在网上查了一下,没有其他人有这样的问题。我该如何解决?

标签: androidfluttermobile

解决方案


java.nio.file.AccessDeniedException

Flutter 可能没有访问特定文件的权限。

如果您使用的是命令提示符,请尝试以管理员权限运行它。如果您使用的是 Android Studio,请尝试以管理员身份打开 Android Studio。


推荐阅读