gpt4 book ai didi

flutter - 运行项目报错 "package_config.json does not exist"

转载 作者:行者123 更新时间:2023-12-05 01:30:25 29 4
gpt4 key购买 nike

我目前正在学习 flutter 。突然,当我尝试运行我的项目时,我收到错误消息“D:..\android.dart_tool\package_config.json 不存在。您是否从与您的 pubspec.yaml 文件相同的目录运行此命令?”。我已经检查了该目录,它是正确的。当我转到指定的目录时,没有 package_config.json。有人可以告诉我如何修复这个?或者如何重新创建 json 文件?提前谢谢你。

enter image description here

    Microsoft Windows [Version 10.0.19042.906]
(c) Microsoft Corporation. All rights reserved.

D:\FlutterProject\wndr2u>flutter run
Using hardware rendering with device AOSP on IA Emulator. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
D:\FlutterProject\wndr2u\android\.dart_tool\package_config.json does not exist.
Did you run this command from the same directory as your pubspec.yaml file?


FAILURE: Build failed with an exception.

* Where:
Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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 1s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 2,703ms
Exception: Gradle task assembleDebug failed with exit code 1

最佳答案

  1. flutter 干净
  2. Flutter 发布
  3. 在android模块中打开项目
  4. 生成 APK 或 bundle

关于flutter - 运行项目报错 "package_config.json does not exist",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67073233/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com