zoukankan      html  css  js  c++  java
  • flutter run出现The getter 'body1' isn't defined for the class 'TextTheme'.

    $ flutter run
    The plugins `amap_location, permission_handler` use a deprecated version of the Android embedding.
    To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
    If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
    Launching libmain.dart on RMX3115 in debug mode...
    Running Gradle task 'assembleDebug'...
    /D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.10.0/lib/src/behaviors/legend/legend_entry_layout.dart:134:45: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
     - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/D:/flutter/flutter/packages/flutter/lib/src/material/text_theme.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
          color ??= Theme.of(context).textTheme.body1.color;
                                                ^^^^^


    FAILURE: Build failed with an exception.

    * Where:
    Script 'D:flutterflutterpackagesflutter_toolsgradleflutter.gradle' line: 1005

    * What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.
    > Process 'command 'D:flutterflutterinflutter.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 12s
    Running Gradle task 'assembleDebug'...                             78.1s
    Exception: Gradle task assembleDebug failed with exit code 1

    版本问题。将flutter_windows_2.5.3-stable替换为flutter_windows_2.2.1-stable解决。

  • 相关阅读:
    50个好用的前端框架,千万收好以留备用!
    嫦娥五号顺利升空,NASA、欧洲航天局回应
    【电脑故障排查】第1章 BIOS和主板故障
    我的老博客——我在chinaunix的家
    Linux操作系统(第二版)(RHEL 8/CentOS 8)
    Java Web整合开发(21) -- 宏观把握Hibernate
    3 远程仓库
    PHP设计模式-策略模式 转
    ubuntu server设置时区和更新时间
    ubuntu 重启 nginx 失败,* Restarting nginx nginx ...fail!
  • 原文地址:https://www.cnblogs.com/xkxf/p/15472707.html
Copyright © 2011-2022 走看看