Flutter 错误:键入';ui.TextHeightBehavior';未在颤振中找到
我在终端命令中构建appbundle时遇到了一个问题 编译器消息:Flutter 错误:键入';ui.TextHeightBehavior';未在颤振中找到,flutter,dart,android-app-bundle,flutter-channel,flutter-build,Flutter,Dart,Android App Bundle,Flutter Channel,Flutter Build,我在终端命令中构建appbundle时遇到了一个问题 编译器消息: ../../flutter/packages/flutter/lib/src/widgets/basic.dart:5149:9: Error: Type 'ui.TextHeightBehavior' not found. final ui.TextHeightBehavior textHeightBehavior; ^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/basic.dart:5149:9: Error: Type 'ui.TextHeightBehavior' not found.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:149:9: Error: Type 'ui.TextHeightBehavior' not found.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:432:9: Error: Type 'ui.TextHeightBehavior' not found.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:78:5: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:281:3: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior get textHeightBehavior => _textPainter.textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:282:26: Error: Type 'ui.TextHeightBehavior' not found.
set textHeightBehavior(ui.TextHeightBehavior value) {
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:145:5: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:346:3: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior get textHeightBehavior => _textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:347:3: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior _textHeightBehavior;
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:348:26: Error: Type 'ui.TextHeightBehavior' not found.
set textHeightBehavior(ui.TextHeightBehavior value) {
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_style.dart:1070:5: Error: Type 'ui.TextHeightBehavior' not found.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/basic.dart:5149:12: Error: 'TextHeightBehavior' isn't a type.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:149:12: Error: 'TextHeightBehavior' isn't a type.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:200:43: Error: 'TextHeightBehavior' isn't a type.
properties.add(DiagnosticsProperty<ui.TextHeightBehavior>('textHeightBehavior', textHeightBehavior, defaultValue: null));
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:432:12: Error: 'TextHeightBehavior' isn't a type.
final ui.TextHeightBehavior textHeightBehavior;
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/widgets/text.dart:487:43: Error: 'TextHeightBehavior' isn't a type.
properties.add(DiagnosticsProperty<ui.TextHeightBehavior>('textHeightBehavior', textHeightBehavior, defaultValue: null));
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:78:8: Error: 'TextHeightBehavior' isn't a type.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/rendering/paragraph.dart:282:29: Error: 'TextHeightBehavior' isn't a type.
set textHeightBehavior(ui.TextHeightBehavior value) {
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:145:8: Error: 'TextHeightBehavior' isn't a type.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:347:6: Error: 'TextHeightBehavior' isn't a type.
ui.TextHeightBehavior _textHeightBehavior;
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:348:29: Error: 'TextHeightBehavior' isn't a type.
set textHeightBehavior(ui.TextHeightBehavior value) {
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_painter.dart:422:7: Error: No named parameter with the name 'textHeightBehavior'.
textHeightBehavior: _textHeightBehavior,
^^^^^^^^^^^^^^^^^^
org-dartlang-sdk:///flutter/lib/ui/text.dart:865:3: Context: Found this candidate, but the arguments don't match.
ParagraphStyle({
^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_style.dart:1070:8: Error: 'TextHeightBehavior' isn't a type.
ui.TextHeightBehavior textHeightBehavior,
^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_style.dart:1091:7: Error: No named parameter with the name 'textHeightBehavior'.
textHeightBehavior: textHeightBehavior,
^^^^^^^^^^^^^^^^^^
org-dartlang-sdk:///flutter/lib/ui/text.dart:865:3: Context: Found this candidate, but the arguments don't match.
ParagraphStyle({
^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
**这是我的颤振医生:**
[✓] 颤振(Mac OS X 10.15.2上的主通道,v1.14.7-pre.83
19C57,区域设置en ID)
•颤振版本1.14.7-83之前at/Users/mac/颤振
•框架版本e10df3c1a6(两天前),2020-02-01 11:23:01+0800
•发动机版本e625e174c5
•Dart版本2.8.0(版本2.8.0-dev.6.0 5ae5aff640)
[✓] Android工具链-为Android设备开发(Android SDK
版本29.0.2)
•Android SDK at/Users/mac/Library/Android/SDK
•未配置Android NDK位置(可选;用于本机评测支持)
•平台android-29,构建工具29.0.2
•Java二进制地址:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/Java
•Java版本OpenJDK运行时环境(build 1.8.0_202-release-1483-b49-5587405)
•接受所有Android许可证
[✓] Xcode-为iOS和macOS开发(Xcode 11.3.1)
•Xcode at/Applications/Xcode.app/Contents/Developer
•Xcode 11.3.1,构建版本11C504
•CocoaPods版本1.8.4
[✓] Android Studio(3.5版)
•Android Studio位于/Applications/Android Studio.app/Contents
•颤振插件版本43.0.1
•Dart插件版本191.8593
•Java版本OpenJDK运行时环境(build 1.8.0_202-release-1483-b49-5587405)
[✓] IntelliJ IDEA社区版(2018.2.2版)
•IntelliJ at/Applications/IntelliJ IDEA CE.app
•颤振插件版本29.1.3
•Dart插件版本182.4129.13
以前我成功地将我的应用程序上传到Google Playstore。但是当我想更新我的应用程序时,我面临这个问题。在更改你的Flatter master之前谢谢你
在项目结束时写下
颤振通道稳定您似乎正在使用旧的颤振
主
通道来修复升级到最新的稳定
通道
要按照此命令切换频道,请执行以下操作:
flutter channel stable
flutter clean
然后跑
flutter upgrade //to ensure you're on the latest.
在应用程序的pubspec.yaml文件中,查找以下行:flatter\u widget\u from\u html并使用^0.5.1+3版本 例如:
flatter\u小部件来自html:^0.5.1+3
然后点击Pub升级并运行你的应用程序
你能显示你的代码而不是错误吗?!请考虑修改你在这个问题中发布的代码示例。在这里发现一个内容问题;改进您的格式和代码示例,我(或其他人)很乐意恢复它。祝您的代码好运!flutter upgrade //to ensure you're on the latest.