gpt4 book ai didi

flutter - Flutter : Error: Method not found: 'createClient'

转载 作者:行者123 更新时间:2023-12-03 07:39:03 24 4
gpt4 key购买 nike

昨天下午我正在运行我的Flutter应用程序,并且运行良好
但是昨天晚上,我尝试运行该应用程序,但是构建失败,并显示错误消息
错误讯息

/C:/flutter-SDK/flutter_windows_v1.12.13+hotfix.8-stable/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/client.dart:35:23: Error: Method not found: 'createClient'.
factory Client() => createClient();
^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\flutter-SDK\flutter_windows_v1.12.13+hotfix.8-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter-SDK\flutter_windows_v1.12.13+hotfix.8-stable\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 1m 42s
Exception: Gradle task assembleDebug failed with exit code 1


=============================================================================================
flutter doctor:
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.19041.685], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.52.1)
[√] Connected device (1 available)

• No issues found!

最佳答案

运行以下命令:

flutter packages pub run build_runner build --delete-conflicting-outputs

关于flutter - Flutter : Error: Method not found: 'createClient' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65475338/

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