我在终端命令中 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/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.
- Where: Script '/Users/mac/Downloads/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 801
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/mac/Downloads/flutter/bin/flutter'' finished with non-zero exit value 1
**这是我的 flutter 医生:**[✓] Flutter (Channel master, v1.14.7-pre.83, on Mac OS X 10.15.2 19C57, locale en-ID) • Flutter version 1.14.7-pre.83 at /Users/mac/flutter • Framework revision e10df3c1a6 (2 days ago), 2020-02-01 11:23:01 +0800 • Engine revision e625e174c5 • Dart version 2.8.0 (build 2.8.0-dev.6.0 5ae5aff640)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/mac/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.8.4
[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 43.0.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] IntelliJ IDEA Community Edition (version 2018.2.2) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 29.1.3 • Dart plugin version 182.4129.13
以前我成功将我的应用程序上传到 Google Playstore。但是当我想更新我的应用程序时,我遇到了这个问题。先谢谢你
最佳答案
改变你的 flutter 大师
在你的项目写的终端
flutter channel 稳定
关于flutter - 错误 : Type 'ui.TextHeightBehavior' not found in flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60040242/