【发布时间】:2022-06-17 05:39:32
【问题描述】:
我创建并运行了一个基于位置和天气的应用。但是当我关闭 VS Code 并尝试重新安装应用程序时,出现以下错误!。 如何消除错误!。
Launching lib\main.dart on Infinix X655C in debug mode...
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/io_client.dart:35:34: Error: Expected ')' before this.
var ioRequest = (hellawait _inner!.openUrl(request.method, request.url))
^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/io_client.dart:35:24: Error: The getter 'hellawait' isn't defined for the class 'IOClient'.
- 'IOClient' is from 'package:http/src/io_client.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/io_client.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'hellawait'.
var ioRequest = (hellawait _inner!.openUrl(request.method, request.url))
^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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 50s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
【问题讨论】:
-
您不知何故不小心修改了
.pub-cache目录中的代码(可能是通过错误的全局搜索/替换?)。我建议删除C:\flutter\.pub-cache\hosted\pub.dartlang.org\http-0.13.4并重新运行flutter pub get。 -
它帮助了我。非常感谢!
标签: flutter dart flutter-dependencies flutter-web