Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跑不了 #33

Closed
zufeng1987 opened this issue Jun 19, 2019 · 20 comments
Closed

跑不了 #33

zufeng1987 opened this issue Jun 19, 2019 · 20 comments

Comments

@zufeng1987
Copy link

可能是我不会操作
运行 flutter run 提示如下
Compiler message:
lib/widgets/image/cached_network_image.dart:197:38: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.

  • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
  • 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
    oldImageStream?.removeListener(_handleImageChanged);
    ^
    lib/widgets/image/cached_network_image.dart:198:32: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
  • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
  • 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
    _imageStream.addListener(_handleImageChanged);
    ^
    lib/widgets/image/cached_network_image.dart:208:34: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
  • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
  • 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
    _imageStream?.removeListener(_handleImageChanged);
    ^
    lib/widgets/image/cached_network_image.dart:463:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable Function()'.
  • 'StringBuffer' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'.
  • 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable Function()'.
    informationCollector: (StringBuffer information) {
    ^
    file:///E:/kaifa/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/palette_generator-0.1.1/lib/palette_generator.dart:188:29: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
  • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
  • 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
    stream.removeListener(imageListener);
    ^
    file:///E:/kaifa/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/palette_generator-0.1.1/lib/palette_generator.dart:194:31: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
  • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
  • 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
    stream.removeListener(imageListener);
    ^
    file:///E:/kaifa/flutter/flutter/.pub-cache/hosted/pub.flutter-io.cn/palette_generator-0.1.1/lib/palette_generator.dart:201:24: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
  • 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
  • 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///E:/kaifa/flutter/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
    stream.addListener(imageListener);
    ^
    Compiler failed on E:\kaifa\yuanma\FlutterDouBan-master-new\lib/main.dart

FAILURE: Build failed with an exception.

  • Where:
    Script 'E:\kaifa\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 691

  • What went wrong:
    Execution failed for task ':app:compileflutterBuildDebugX86'.

Process 'command 'E:\kaifa\flutter\flutter\bin\flutter.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

@kaina404
Copy link
Owner

你的flutter sdk是多少

@zufeng1987
Copy link
Author

你的flutter sdk是多少

E:\kaifa\flutter\flutter\bin 这是flutter 的
E:\kaifa\Android_Studio\SDK 这是 AS的

@kaina404
Copy link
Owner

版本号 @zufeng1987

@kaina404
Copy link
Owner

你执行flutter --version

@zufeng1987
Copy link
Author

flutter 是 1.7.4

@zufeng1987
Copy link
Author

PS E:\kaifa\yuanma\FlutterDouBan-master-new> flutter --version
Flutter 1.7.4 • channel dev • https://github.com/flutter/flutter.git
Framework • revision dfecafa4ab (5 days ago) • 2019-06-14 09:46:23 -0700
Engine • revision 2589785b5c
Tools • Dart 2.4.0

@kaina404
Copy link
Owner

Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (7 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

@kaina404
Copy link
Owner

这是我的:
Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (7 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

@zufeng1987
Copy link
Author

哦哦 就是要下个 1.5.4 对吧

@kaina404
Copy link
Owner

你可以切换下flutter sdk版本 跑一下,还有pubspec.yaml的配置文件的版本号不要变化。

@zufeng1987
Copy link
Author

这个 我百度下 我初学 什么都不懂 ....

@kaina404
Copy link
Owner

@zufeng1987 一步步来,都是这么过来的。

@zufeng1987
Copy link
Author

嗯 谢谢啦 有什么微信群什么的吗 我想多点渠道学起来快点

@kaina404
Copy link
Owner

@zufeng1987 我在这个群里:468010872,目前有897人了

@zufeng1987
Copy link
Author

好的 谢谢了

@kaina404
Copy link
Owner

@zufeng1987 如果你还有看这个项目,更新代码即可解决这个问题。谢谢

@x307799853
Copy link

我拉取了master-new最新代码,也是这个错误。
运行版本:
Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (3 months ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

@x307799853
Copy link

Compiler message:
lib/util/palette_generator.dart:187:5: Error: 'ImageStreamListener' isn't a type.
ImageStreamListener l;
^^^^^^^^^^^^^^^^^^^
lib/util/palette_generator.dart:195:9: Error: Method not found: 'ImageStreamListener'.
l = ImageStreamListener(imageListener);
^^^^^^^^^^^^^^^^^^^
Compiler failed on D:\flutter\flutterDouBan\lib/main.dart

@liangtongdev
Copy link

同样的问题

Xcode's output:

=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===

Compiler message:
lib/util/palette_generator.dart:187:5: Error: 'ImageStreamListener' isn't a type.
    ImageStreamListener l;
    ^^^^^^^^^^^^^^^^^^^
lib/util/palette_generator.dart:195:9: Error: Method not found: 'ImageStreamListener'.
    l = ImageStreamListener(imageListener);
        ^^^^^^^^^^^^^^^^^^^
Compiler failed on /Users/liangtong/Documents/fun/flutter/FlutterDouBan/lib/main.dart
Failed to package /Users/liangtong/Documents/fun/flutter/FlutterDouBan.

Could not build the precompiled application for the device.

@yestodayHadRain
Copy link

我也遇到了这个问题了,然后把flutter版本升级到和作者一样的ImageStreamListener还是报错

Flutter 1.5.4 • channel unknown • unknown source
Framework • revision b593f5167b (1 year, 6 months ago) • 2019-04-22 07:51:33 -0700
Engine • revision ca31a7c57b
Tools • Dart 2.3.0 (build 2.3.0-dev.0.1 cf4444b803)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants