Shr*_*rma 7 dart flutter flutter-dependencies
我的 flutter 应用程序无法在2.5.0-5.3.prebeta 版本上运行。之后我搜索了它,然后需要升级我的 flutter sdk,因此已升级到最新的 beta 版本 2.6.0-5.2.pre,但仍然出现错误。\nplace_picker-0.9.19-nullsafety插件的错误。并且无法解决它。
错误日志:
\n../../../../Workspace/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/rich_suggestion.dart:35:89: Error: The getter \'body1\' isn\'t defined for the class \'TextTheme\'.\n - \'TextTheme\' is from \'package:flutter/src/material/text_theme.dart\' (\'../../../../Workspace/flutter/packages/flutter/lib/src/material/text_theme.dart\').\nTry correcting the name to the name of an existing getter, or defining a getter or field named \'body1\'.\n TextSpan(text: boldText, style: style.copyWith(color: Theme.of(context).textTheme.body1!.color)),\n ^^^^^\n../../../../Workspace/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/search_input.dart:60:65: Error: The getter \'body1\' isn\'t defined for the class \'TextTheme\'.\n - \'TextTheme\' is from \'package:flutter/src/material/text_theme.dart\' (\'../../../../Workspace/flutter/packages/flutter/lib/src/material/text_theme.dart\').\nTry correcting the name to the name of an existing getter, or defining a getter or field named \'body1\'.\n Icon(Icons.search, color: Theme.of(context).textTheme.body1!.color),\n ^^^^^\n\n\nFAILURE: Build failed with an exception.\n\n* Where:\nScript \'/Users/brightroots/Workspace/flutter/packages/flutter_tools/gradle/flutter.gradle\' line: 1005\n\n* What went wrong:\nExecution failed for task \':app:compileFlutterBuildDebug\'.\n> Process \'command \'/Users/brightroots/Workspace/flutter/bin/flutter\'\' finished with non-zero exit value 1\n\n* Try:\nRun 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.\n\n* Get more help at https://help.gradle.org\n\nBUILD FAILED in 31s\n\nRun Code Online (Sandbox Code Playgroud)\n错误:
\n\n我当前的 FUTTER 版本:
\nFlutter 2.6.0-5.2.pre \xe2\x80\xa2 channel beta \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision 400608f101 (8 days ago) \xe2\x80\xa2 2021-09-15 15:50:26 -0700\nEngine \xe2\x80\xa2 revision 1d521d89d8\nTools \xe2\x80\xa2 Dart 2.15.0 (build 2.15.0-82.2.beta)\nRun Code Online (Sandbox Code Playgroud)\n
我正在处理这个错误。就我而言,这是因为存在与 flutter 2.5 不兼容的依赖项。我尝试了很多解决方案。但只有这个对我有用。
首先将其添加到您的 pubspec.yaml 中
charts_flutter:
git:
url: git://github.com/google/charts.git
path: charts_flutter
Run Code Online (Sandbox Code Playgroud)
如此链接所述 。
如果您有错误提示:remote end hung up unexpectedly while git cloning,
然后运行这个命令
git config --global http.postBuffer 500M
git config --global http.maxRequestBuffer 100M
git config --global core.compression 0
Run Code Online (Sandbox Code Playgroud)
这解决了我的问题。
| 归档时间: |
|
| 查看次数: |
16543 次 |
| 最近记录: |