【问题标题】:Error while compling my app in Flutter in VScode and android studio在 VScode 和 android studio 中在 Flutter 中编译我的应用程序时出错
【发布时间】: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 并重新安装吗?

标签: android flutter gradle


【解决方案1】:

我遇到了同样的问题并解决了

找到文件“signing-config.json”并将权限更改为完全控制 C:\Users\shubh\OneDrive\Desktop\myCode\myApp\my_app\build\app\intermediates\signing_config\debug\out\signing-config.json

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-24
    • 2020-10-23
    • 1970-01-01
    • 2019-02-21
    • 1970-01-01
    • 1970-01-01
    • 2020-11-11
    • 2022-01-25
    相关资源
    最近更新 更多