【发布时间】:2020-09-07 06:03:16
【问题描述】:
import 'package:flutter/material.dart';
void main () {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
Widget build (BuildContext context) {
return MaterialApp(home: Text('Hello!'),);
}
}
这是我在 Flutter 上运行 main.dart 时的应用程序,出现以下错误。我已经使用模拟器正确安装了 Android Studio。我使用 VS Code 进行编辑。我将 git bash 作为终端运行。 Flutter 医生表示一切正常。
如何解决我的问题?
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> java.io.FileNotFoundException: C:\Users\shubh\OneDrive\Desktop\myCode\myApp\my_app\build\app\intermediates\signing_config\debug\out\signing-config.json (Access is denied)
* 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 8s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> java.io.FileNotFoundException: C:\Users\shubh\OneDrive\Desktop\myCode\myApp\my_app\build\app\intermediates\signing_config\debug\out\signing-config.json (Access is denied)
* 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
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
【问题讨论】:
-
Gradle threw an error while downloading artifacts from the network主要与不稳定的互联网连接有关。您可以删除 Gradle 并重新安装吗?