Flutter Channel渠道,更新Flutter SDK

flutter  --version  列出所有版本

flutter channel 列出当前所有渠道稳定版,开发版等  和目前所在的渠道版本

master           为当前最新的channel;

dev                为当前最新且充分测试后的channel;

beta              为每月Flutter官方调整选出来的最好的dev的channel;

stable            为当前最稳定的channel。

稳定性排序:master < dev < beta < stable 

更新Flutter SDK

在命令行中运行命令:“flutter upgrade --force”。 

有的小伙伴用“flutter upgrade” 可能会报错。所以这里推荐用强制更新。

耐心等待大约10分钟,当出现下面界面的时候,说明更新完了。

更新后,运行项目,很奇怪报了错误信息,错误信息如下:

Running Gradle task 'assembleDebug'...

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/path_provider_windows-0.0.4+3/lib/src/path_provider_windows_real.dart:126:25: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

          knownFolderID.addressOf, KF_FLAG_DEFAULT, NULL, pathPtrPtr);

                        ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:1067:7: Error: The getter 'addressOf' isn't defined for the class 'LOGFONT'.

- 'LOGFONT' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

      addressOf.cast<Uint8>().elementAt(28).cast<Utf16>();

      ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:1112:29: Error: The getter 'addressOf' isn't defined for the class 'ENUMLOGFONTEX'.

- 'ENUMLOGFONTEX' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  LOGFONT get elfLogFont => addressOf.cast<LOGFONT>().ref;

                            ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:1114:29: Error: The getter 'addressOf' isn't defined for the class 'ENUMLOGFONTEX'.

- 'ENUMLOGFONTEX' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  String get elfFullName => addressOf

                            ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:1120:26: Error: The getter 'addressOf' isn't defined for the class 'ENUMLOGFONTEX'.

- 'ENUMLOGFONTEX' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  String get elfStyle => addressOf

                        ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:1126:27: Error: The getter 'addressOf' isn't defined for the class 'ENUMLOGFONTEX'.

- 'ENUMLOGFONTEX' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  String get elfScript => addressOf

                          ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2688:7: Error: The getter 'addressOf' isn't defined for the class 'OSVERSIONINFO'.

- 'OSVERSIONINFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

      addressOf.cast<Uint8>().elementAt(20).cast<Utf16>().unpackString(128);

      ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2699:11: Error: The getter 'addressOf' isn't defined for the class 'OSVERSIONINFO'.

- 'OSVERSIONINFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        ..addressOf.cast<Uint8>().elementAt(20).value = 0;

          ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2744:24: Error: The getter 'addressOf' isn't defined for the class 'BLUETOOTH_DEVICE_INFO'.

- 'BLUETOOTH_DEVICE_INFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  String get szName => addressOf

                      ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2837:7: Error: The getter 'addressOf' isn't defined for the class 'BLUETOOTH_PIN_INFO'.

- 'BLUETOOTH_PIN_INFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

      addressOf.cast<Uint8>().elementAt(BTH_MAX_PIN_SIZE).value;

      ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2840:5: Error: The getter 'addressOf' isn't defined for the class 'BLUETOOTH_PIN_INFO'.

- 'BLUETOOTH_PIN_INFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    addressOf.cast<Uint8>().elementAt(BTH_MAX_PIN_SIZE).value =

    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2845:28: Error: The getter 'addressOf' isn't defined for the class 'BLUETOOTH_PIN_INFO'.

- 'BLUETOOTH_PIN_INFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

      String.fromCharCodes(addressOf.cast<Uint8>().asTypedList(pinLength));

                          ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2853:7: Error: The getter 'addressOf' isn't defined for the class 'BLUETOOTH_PIN_INFO'.

- 'BLUETOOTH_PIN_INFO' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

      addressOf.cast<Uint8>().elementAt(idx).value = pinData[idx];

      ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart:38:31: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  final iid = GUID.allocate().addressOf;

                              ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart:56:33: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  final clsid = GUID.allocate().addressOf;

                                ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/winrt/winrt_helpers.dart:86:40: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  final riidCalendar = GUID.allocate().addressOf;

                                      ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IDesktopWallpaper.dart:197:38: Error: The getter 'addressOf' isn't defined for the class 'COMObject'.

- 'COMObject' is from 'package:win32/src/com/combase.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final ptr = COMObject.allocate().addressOf;

                                    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IDesktopWallpaper.dart:200:49: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(CLSID_DesktopWallpaper).addressOf,

                                                ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IDesktopWallpaper.dart:203:48: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(IID_IDesktopWallpaper).addressOf,

                                              ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IFileOpenDialog.dart:58:38: Error: The getter 'addressOf' isn't defined for the class 'COMObject'.

- 'COMObject' is from 'package:win32/src/com/combase.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final ptr = COMObject.allocate().addressOf;

                                    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IFileOpenDialog.dart:61:47: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(CLSID_FileOpenDialog).addressOf,

                                              ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IFileOpenDialog.dart:64:46: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(IID_IFileOpenDialog).addressOf,

                                            ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IFileSaveDialog.dart:99:38: Error: The getter 'addressOf' isn't defined for the class 'COMObject'.

- 'COMObject' is from 'package:win32/src/com/combase.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final ptr = COMObject.allocate().addressOf;

                                    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IFileSaveDialog.dart:102:47: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(CLSID_FileSaveDialog).addressOf,

                                              ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IFileSaveDialog.dart:105:46: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(IID_IFileSaveDialog).addressOf,

                                            ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IKnownFolderManager.dart:164:38: Error: The getter 'addressOf' isn't defined for the class 'COMObject'.

- 'COMObject' is from 'package:win32/src/com/combase.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final ptr = COMObject.allocate().addressOf;

                                    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IKnownFolderManager.dart:167:51: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(CLSID_KnownFolderManager).addressOf,

                                                  ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IKnownFolderManager.dart:170:50: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(IID_IKnownFolderManager).addressOf,

                                                ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/INetworkListManager.dart:128:38: Error: The getter 'addressOf' isn't defined for the class 'COMObject'.

- 'COMObject' is from 'package:win32/src/com/combase.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final ptr = COMObject.allocate().addressOf;

                                    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/INetworkListManager.dart:131:51: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(CLSID_NetworkListManager).addressOf,

                                                  ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/INetworkListManager.dart:134:50: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        GUID.fromString(IID_INetworkListManager).addressOf,

                                                ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IWbemLocator.dart:82:38: Error: The getter 'addressOf' isn't defined for the class 'COMObject'.

- 'COMObject' is from 'package:win32/src/com/combase.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/com/combase.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final ptr = COMObject.allocate().addressOf;

                                    ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IWbemLocator.dart:84:68: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

    final hr = CoCreateInstance(GUID.fromString(CLSID_WbemLocator).addressOf,

                                                                  ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/generated/IWbemLocator.dart:85:64: Error: The getter 'addressOf' isn't defined for the class 'GUID'.

- 'GUID' is from 'package:win32/src/structs.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

        nullptr, CLSCTX_ALL, GUID.fromString(IID_IWbemLocator).addressOf, ptr);

                                                              ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3/lib/src/utf8.dart:63:33: Error: The getter 'addressOf' isn't defined for the class 'Utf8'.

- 'Utf8' is from 'package:ffi/src/utf8.dart' ('../../../../../../.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3/lib/src/utf8.dart').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.

  String toString() => fromUtf8(addressOf);

                                ^^^^^^^^^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:1111:7: Error: Struct 'ENUMLOGFONTEX' is empty. Empty structs are undefined behavior.

class ENUMLOGFONTEX extends Struct {

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2835:7: Error: Struct 'BLUETOOTH_PIN_INFO' is empty. Empty structs are undefined behavior.

class BLUETOOTH_PIN_INFO extends Struct {

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2960:7: Error: Struct 'EXCEPINFO' is empty. Empty structs are undefined behavior.

class EXCEPINFO extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2966:7: Error: Struct 'PROPERTYKEY' is empty. Empty structs are undefined behavior.

class PROPERTYKEY extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2973:7: Error: Struct 'PROPVARIANT' is empty. Empty structs are undefined behavior.

class PROPVARIANT extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2978:7: Error: Struct 'SAFEARRAY' is empty. Empty structs are undefined behavior.

class SAFEARRAY extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2985:7: Error: Struct 'CLSID' is empty. Empty structs are undefined behavior.

class CLSID extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2992:7: Error: Struct 'STATSTG' is empty. Empty structs are undefined behavior.

class STATSTG extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4+1/lib/src/structs.dart:2999:7: Error: Struct 'NLM_SIMULATED_PROFILE_INFO' is empty. Empty structs are undefined behavior.

class NLM_SIMULATED_PROFILE_INFO extends Struct {}

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3/lib/src/utf8.dart:23:7: Error: Struct 'Utf8' is empty. Empty structs are undefined behavior.

class Utf8 extends Struct {

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3/lib/src/utf16.dart:16:7: Error: Struct 'Utf16' is empty. Empty structs are undefined behavior.

class Utf16 extends Struct {

      ^

../../../../../../.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3/lib/src/allocation.dart:47:33: Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'.

  final int totalSize = count * sizeOf<T>();

                                ^

FAILURE: Build failed with an exception.

* Where:

Script '/Users/cheryl/Documents/work/sdk/flutter_sdk/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035

* What went wrong:

Execution failed for task ':app:compileFlutterBuildDebug'.

> Process 'command '/Users/cheryl/Documents/work/sdk/flutter_sdk/flutter/bin/flutter'' 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 12s

Exception: Gradle task assembleDebug failed with exit code 1


我在网上尝试了好多种解决方法

首先清除缓存: flutter clean

如果不行,使用:flutter packages cache repair

结果尝试好多遍依旧不行,报错,后来重启项目,错误信息没有了,项目可以运行了,很奇怪。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,294评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,493评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,790评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,595评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,718评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,906评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,053评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,797评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,250评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,570评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,711评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,388评论 4 332
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,018评论 3 316
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,796评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,023评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,461评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,595评论 2 350

推荐阅读更多精彩内容