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

Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'. - 'DiagnosticsNode' is from #31962

Closed
calvinmuller opened this issue May 2, 2019 · 59 comments

Comments

@calvinmuller
Copy link

commented May 2, 2019

After upgrading to 1.5.9-pre.108 I seem to be getting this issue with 3 packages I use, should I take this up with the packages or is it something that you guys will fix?

Pacakges affected in my project:

multi_image_picker: ^4.2.0
flutter_sticky_header: ^0.3.4
cached_network_image: ^0.7.0

Steps to Reproduce

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_sticky_header/flutter_sticky_header.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: Page1(),
    );
  }
}

class Page1 extends StatelessWidget {
  final String title;

  const Page1({Key key, this.title = "Page 1"}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(title),
        ),
        body: CustomScrollView(
          slivers: <Widget>[
            SliverStickyHeader(
              header: Text('Users'),
              sliver: SliverList(
                delegate: SliverChildBuilderDelegate(
                  (context, i) => Text(i.toString()),
                ),
              ),
            ),
          ],
        ));
  }
}

Added pubspec dependency

  flutter_sticky_header: ^0.3.4

attempt to build the project.

Logs

Compiler message:
file:///Users/calvinmuller/.pub-cache/hosted/pub.dartlang.org/flutter_sticky_header-0.3.4/lib/src/widgets/sticky_header_layout_builder.dart:147:16: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/calvinmuller/iStreet/Mobile/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
      context: context);
               ^
Compiler failed on /Users/calvinmuller/iStreet/Mobile/testwhite/lib/main.dart
Error launching application on iPhone X.

Compiler message:
file:///Users/calvinmuller/.pub-cache/hosted/pub.dartlang.org/cached_network_image-0.7.0/lib/src/cached_network_image_provider.dart:46:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/calvinmuller/iStreet/Mobile/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer information) {
                              ^
file:///Users/calvinmuller/.pub-cache/hosted/pub.dartlang.org/multi_image_picker-4.2.0/lib/src/asset_thumb_provider.dart:35:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/calvinmuller/iStreet/Mobile/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer information) {

[✓] Flutter (Channel master, v1.5.9-pre.108, on Mac OS X 10.14.4 18E226, locale en-ZA)
    • Flutter version 1.5.9-pre.108 at /Users/calvinmuller/iStreet/Mobile/flutter
    • Framework revision 15f187fce0 (89 minutes ago), 2019-05-01 20:39:37 -0700
    • Engine revision ce9e9ba7e4
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 b6997deb3e)


@Zazo032

This comment has been minimized.

Copy link

commented May 2, 2019

This might be related to Dart 2.3.0 version bump, here you can find a temporary workaround for cached_network_image (should also work for the other 2 packages): renefloor/flutter_cached_network_image#171 (comment)

@calvinmuller

This comment has been minimized.

Copy link
Author

commented May 2, 2019

it feels sooo wrong - but for now it will have to do, given i've been building against master its way to difficult to go back now!

Thanks!

@vijayawoshe

This comment has been minimized.

Copy link

commented May 2, 2019

For me 4 to 5 Plugins are failing
1.sentry
2. flutter_advanced_networkimage
3.cached_network_image_provider
4. fllushbar
5. flutter_svg etc

with the same errors.

Compiler message:
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/picture_provider.dart:337:33: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
          informationCollector: (StringBuffer information) {
                                ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/picture_provider.dart:432:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer information) {
                              ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/picture_provider.dart:495:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer information) {
                              ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/picture_provider.dart:559:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer information) {
                              ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/flutter_advanced_networksvg.dart:106:29: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
      informationCollector: (StringBuffer information) {
                            ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.5.0/lib/flare.dart:1023:18: Error: The argument type 'Int32List' can't be assigned to the parameter type 'Uint16List'.
 - 'Int32List' is from 'dart:typed_data'.
 - 'Uint16List' is from 'dart:typed_data'.
Try changing the type of the parameter, or casting the argument to 'Uint16List'.
        indices: _indices, textureCoordinates: _uvBuffer);
                 ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/picture_stream.dart:252:16: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
      context: context,
               ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/picture_stream.dart:297:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
        context: 'resolving a single-frame picture stream',
                 ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/svg/parser_state.dart:395:35: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
            informationCollector: (StringBuffer buff) {
                                  ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/svg/parser_state.dart:404:22: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
            context: 'in _Element.clipPath',
                     ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/svg/parser_state.dart:777:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer buff) {
                              ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/svg/parser_state.dart:788:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
        context: 'in parseSvgElement',
                 ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/utilities/errors.dart:8:32: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
      context: 'in $methodName',
                               ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.0/lib/src/utilities/errors.dart:10:29: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
      informationCollector: (StringBuffer buff) {
                            ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.3.0/lib/flushbar.dart:528:15: Error: The method 'detach' isn't defined for the class 'FocusScopeNode'.
 - 'FocusScopeNode' is from 'package:flutter/src/widgets/focus_manager.dart' ('file:///C:/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
Try correcting the name to the name of an existing method, or defining a method named 'detach'.
    focusNode.detach();
              ^^^^^^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sticky_header-0.3.4/lib/src/widgets/sticky_header_layout_builder.dart:147:16: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
      context: context);
               ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/flutter_advanced_networkimage.dart:149:29: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
      informationCollector: (StringBuffer information) {
                            ^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-0.7.0/lib/src/cached_network_image_provider.dart:46:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
 - 'StringBuffer' is from 'dart:core'.
 - 'Iterable' is from 'dart:core'.
 - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
        informationCollector: (StringBuffer information) {
                              ^
Compiler failed on C:\Vijay\Workspace\Awoshe\development\Awoshe-Flutter\lib\main.dart
Finished with error: Gradle task assembleDebug failed with exit code 1

This issue has to be solved asap.

Thanks

@thanhhuan1990

This comment has been minimized.

Copy link

commented May 2, 2019

I have gotting the same errors with 2 libs with same issue.

  1. flutter_svg
  2. flutter_image
[✓] Flutter (Channel master, v1.5.9-pre.114, on Mac OS X 10.14.4 18E226, locale en-US)
    • Flutter version 1.5.9-pre.114 at /Users/apple/Development/flutter
    • Framework revision f48cc4611a (19 minutes ago), 2019-05-02 08:02:11 -0700
    • Engine revision bc3bd709c7
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 b6997deb3e)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/apple/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/apple/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.7.0.beta.3

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.0.1
    • Dart plugin version 183.5901
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.33.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.25.1

This issue should be solved asap.
Thanks

@mklim

This comment has been minimized.

Copy link
Member

commented May 2, 2019

The root cause is #30983. The change to context there is breaking. I think it should probably be reverted and relanded in a more gradual migration instead of an in-place breaking change? This also breaks firebase_crashlytics, which passes context over the MethodChannel directly under the asusmption that it's a String.

flutter/plugins CI is currently red based on this.

/cc @jacob314 @kroikie

@mklim

This comment has been minimized.

Copy link
Member

commented May 3, 2019

My mistake, the breaking change was intentional. https://groups.google.com/forum/#!topic/flutter-announce/hp1RNIgej38 #27327

This is unfortunately a difficult breaking change for plugins authors to deal with, since plugins users could be using stable (in which this is a String) or master, in which this is a DiagnosticsNode. Just migrating to the latest version will break users on older versions of Flutter.

I think plugins authors can work around this without breaking either new or old versions of Flutter for now by type checking and handling the property differently depending on what it is. That's not an ideal fix though.

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

We can change the type of context from DiagnosticsNode to Object for a few months to allow for a gradual migration.
Based on analysis of all pub packages this change should break about 13 packages. I am happy to help anyone who needs to migrate their package to migrate it.

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

flutter_svg has been fixed. Let me know if you are still having issues with it.

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

Before making this breaking change we did some analysis of what packages could be impacted. Here is the full list of packages in the public ecosystem that use FlutterErrorDetails. Not all are impacted by the change as the context and informationCollector parameters are not required.

beacons-0.3.0
cool_ui-0.1.14
extended_nested_scroll_view-0.3.2
firebase_crashlytics-0.0.2
fish_redux-0.1.3
flutter_beacons-0.3.0+3
flutter_hooks-0.2.1
flutter_image-1.0.0
flutter_image_compress-0.3.0
flutter_sticky_header-0.3.4
flutter_svg-0.12.2
geolocation-0.2.1
gif_ani-0.0.2
iap-0.1.0
liquid_pull_to_refresh-1.1.0
ls_refresher-0.1.0
pdrpulm-1.0.2
printing-2.0.0
pull_to_refresh_notification-0.2.0
refresh_wow-0.0.7
reorderables-0.2.0
saka_image-0.0.5
streams_channel-0.2.2
tt_image-0.0.1
zefyr-0.5.0
@vijayawoshe

This comment has been minimized.

Copy link

commented May 3, 2019

So what is the temporary work around for now?

@mklim mklim referenced this issue May 3, 2019

Merged

[firebase_crashlytics] Migrate FlutterErrorDetails #1564

12 of 13 tasks complete
@mklim

This comment has been minimized.

Copy link
Member

commented May 3, 2019

@vijayawoshe Users of a plugin broken by this can probably work around it quickest by switching to flutter channel stable instead of flutter channel master so that they avoid the breaking change.

The fix for plugins authors is to update their code to work on both stable and master. That'll probably mean using runtime type checking, unfortunately. You can see how firebase_crashlytics is adapting to this at flutter/plugins#1564.

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

It depends. If you package is trying to act like it is part of the Flutter framework here is an overly clever workaround. Please promise me you will delete the code when this feature is in flutter Stable of you go this route instead of keeping a separate branch for Flutter stable and dev.

final bool _useDiagnosticsNode = FlutterError('text') is Diagnosticable;

dynamic safeContext(String context) {
  return _useDiagnosticsNode ? DiagnosticsNode.message(context) : context;
}

// Example usage
FlutterErrorDetails(context: safeContext('My context message'));

If you package isn't trying to act like it is part of package:flutter then you should consider whether FlutterError and FlutterErrorDetails are classes you should be using. You might be confusing your users more than helping them by making your errors look like they are coming from the framework instead of from your library. For example the documentation for FlutterError says it is an "Error class used to report Flutter-specific assertion failures and contract violations."

@khainhero

This comment has been minimized.

Copy link

commented May 3, 2019

I deleted the context's in the affected files. Should i uninstall and reinstall them back and then should i implement the ternary operator for the issues? (im just a normal end user whose affected by new master build)

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

@khainhero I'm interested in understanding how you are using FlutterErrorDetails in your user code. What are you looking to accomplish using the class? In general this wasn't a class we expected users to use.

@khainhero

This comment has been minimized.

Copy link

commented May 3, 2019

@khainhero I'm interested in understanding how you are using FlutterErrorDetails in your user code. What are you looking to accomplish using the class? In general this wasn't a class we expected users to use.

huh, im not owner of these plugins. I am just normal person using these plugin and I decided to deleted it so i can run my own project because i couldnt compile my project.

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

I would recommend you stick to the stable channel of Flutter as a normal user. Is there a reason you need to be on the dev channel?

Let me know which packages you depend on and I will work with the owners to make sure they migrate soon.

@khainhero

This comment has been minimized.

Copy link

commented May 3, 2019

Oh thanks for the response.
flutter_image_compress 0.4.0 (Diagnostic node issue with String datatype)
cached_network_image 0.7.0

just a quick question i want to throw in:

Should I stick to Stable Channel for releasing an app for alpha/beta testing? Thank you

@jacob314

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

You should stick to stable channel. The stable channel builds should generally be much more robust than the master channel. The stable channel has had months of testing while the master channel has not as new channels are being added to the master channel. On the master channel you never know when a CL will be rolled back if it caused bugs so you can experience breaking changes in your code due to features being removed.

What sorts of stability bugs are you having with the stable channel?

@calvinmuller

This comment has been minimized.

Copy link
Author

commented May 3, 2019

if no-one used master - who would detect these issues? :)

@vijayawoshe

This comment has been minimized.

Copy link

commented May 3, 2019

I am using the master channel since 8 9 month for one important project. Everything was working fine uptil now. I helped flutter to post early issues as well. So to use master channel is fine in my opinion.

Of course with breaking change it happens sometimes
:-)

@Sh1d0w

This comment has been minimized.

Copy link

commented May 3, 2019

I am using the master channel since 8 9 month for one important project. Everything was working fine uptil now. I helped flutter to post early issues as well. So to use master channel is fine in my opinion.

Of course with breaking change it happens sometimes
:-)

The problem is not that are you using the dev channel for production build. The problem is that plugin maintainers can support only against Stable channel, because as @jacob314 said dev channel frequently rolls back and forth breaking changes.

You should never use dev branch for production apps, of course you are free to switch and test new features, but if you want stability you should stick to Stable.

We (open source mantainers) are not working full time on the plugins so we can't guarantee they will work on anything other than stable. If you are using unstable build for production it is your fault. Not to mention that in the semantic versioning there is no way to support both Stable and Unstable channels when it comes to breaking changes.

@Hixie

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

The new stable release is now in the beta channel, assuming we see no problems we will push it to stable soon. Please feel free to switch to the beta channel if this is causing you problems (or in general if you want to!).

@ratsey

This comment has been minimized.

Copy link

commented Jul 9, 2019

Using Beta channel but still seeing the same error in image. Deleted my pubcache and rebuilt, but same. This is definitely resolved in beta?

Compiler message:
file:///C:/Flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image-1.0.0/lib/network.dart:75:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
[√] Flutter (Channel beta, v1.7.8+hotfix.2, on Microsoft Windows [Version 10.0.18362.175], locale en-US)
    • Flutter version 1.7.8+hotfix.2 at C:\Flutter
    • Framework revision 2e540931f7 (6 days ago), 2019-07-02 09:31:07 -0700
    • Engine revision b1cb0d9e9b
    • Dart version 2.4.0

 
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\Jens\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_SDK_ROOT = C:\Users\Jens\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 29.0.2
    • Dart plugin version 181.5540.11
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code, 64-bit edition (version 1.36.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.2.0

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!

tvolkert added a commit to tvolkert/flutter_image that referenced this issue Jul 9, 2019

Update flutter_image per recent changes to framework
* Update analysis options
* Clean up analysis errors
* Update/fix broken API calls

flutter/flutter#31962
@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

The problem is that package:flutter_image is still published as version 1.0.0, which isn't compatible with the current Flutter release. It's received some updates to make it compatible, but those updates haven't yet been published (they'll be 2.0.0).

flutter/flutter_image#15 gets it closer to ready.

@Hixie

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

This change is now on stable, so this now affects any non-updated plugin.

We will make sure all first-party plugins are fixed. Beyond that it is not clear what we should do.

@Hixie Hixie removed the framework label Jul 9, 2019

@amirh

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

Audit of first party plugins:

No first party plugin extends FlutterError.

Usages of FlutterError Details:

  • firebase_crashlytics/example/lib/main.dart: does not instantiate a FlutterErrorDetails or uses context
  • firebase_crashlytics/example/test_driver/crashlytics.dart: does not specify context
    firebase_crashlytics/lib/src/firebase_crashlytics.dart: Uses the new API
    firebase_crashlytics/test/firebase_crashlytics_test.dart: Uses the new API
@Hixie

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

Great. Sounds like once flutter_image is fixed, we can close this.

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

flutter_image was fixed in flutter/flutter_image#13 - it just hasn't been published.

Once flutter/flutter_image#15 lands, I'll publish a new version of flutter_image, and we can close this.

tvolkert added a commit to flutter/flutter_image that referenced this issue Jul 10, 2019

Update flutter_image per recent changes to framework (#15)
* Update analysis options
* Clean up analysis errors
* Update/fix broken API calls

flutter/flutter#31962

@tvolkert tvolkert self-assigned this Jul 10, 2019

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

flutter_image 2.0.0 has been published. This should be fixed now.

@tvolkert tvolkert closed this Jul 10, 2019

@puneetsdsharma65

This comment has been minimized.

Copy link

commented Jul 10, 2019

I have the same issue for latest version of flutter(1.7.8)

Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.

'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/xyz/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: '$runtimeType failed to load ${instructions.uri}'

channel : stable
version 1.7.8

Thanks

@puneetsdsharma65

This comment has been minimized.

Copy link

commented Jul 10, 2019

Same issue for Flutter 1.7.8+hotfix.3

Compiler message:
file:///Users/xyz/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image-1.0.0/lib/network.dart:75: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:///Users/xyz/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) {

on stable channel version
Flutter 1.7.8+hotfix.3

Thanks

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

@puneetsdsharma65 see the messages above - you need to update to flutter_image 2.0.0

@nazmulgazi1989

This comment has been minimized.

Copy link

commented Jul 10, 2019

Compiler message:
.\pub-cache/hosted/pub.dartlang.org/cool_ui-0.1.15/lib/keyboards/keyboard_manager.dart:102:20: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.

  • 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' (.\flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
    context: 'during a platform message response callback',
    ^
    Compiler failed on .\Flutter\ItelMobileAgent\itel_agent\lib\main.dart
    Finished with error: Gradle task assembleDebug failed with exit code 1

How can I solve this?

@rajeshzmoke

This comment has been minimized.

Copy link

commented Jul 10, 2019

file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:256:16: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: context,
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:301:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'resolving a single-frame picture stream',
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:399:35: 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:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable Function()'.
informationCollector: (StringBuffer buff) {
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:408:22: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'in _Element.clipPath',
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:798: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:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable Function()'.
informationCollector: (StringBuffer buff) {
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:809:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'in parseSvgElement',
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:8:32: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'in $methodName',
^
file:///Users/rajeshkumar/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:10:29: 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:///Users/rajeshkumar/Desktop/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable Function()'.
informationCollector: (StringBuffer buff) {

@jacob314

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

Sorry for the inconvenience. You need to upgrade to flutter_svg version 0.13.0 or newer which contains the fix. https://pub.dev/packages/flutter_svg

@jacob314

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

cool_ui-0.1.15
I've sent out a pull request to update cool_ui to be compatible with flutter 1.7. Im-Kevin/cool_ui#20

@CosmoInSpace

This comment has been minimized.

Copy link

commented Jul 10, 2019

@puneetsdsharma65 see the messages above - you need to update to flutter_image 2.0.0

@tvolkert how can I update though? just updated to v1.7.8+hotfix.3 and got this error message.

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

@CosmoInSpace flutter_image isn't shipped with the flutter SDK - it's an independent package. You update your pubspec.yaml to pull in the new version.

@CosmoInSpace

This comment has been minimized.

Copy link

commented Jul 11, 2019

@CosmoInSpace flutter_image isn't shipped with the flutter SDK - it's an independent package. You update your pubspec.yaml to pull in the new version.

Cheers thanks @tvolkert

@andrewsdv

This comment has been minimized.

Copy link

commented Jul 14, 2019

@puneetsdsharma65 see the messages above - you need to update to flutter_image 2.0.0

@tvolkert how can I update though? just updated to v1.7.8+hotfix.3 and got this error message.

The same to me. How to solve this issue??

@andrewsdv

This comment has been minimized.

Copy link

commented Jul 14, 2019

@puneetsdsharma65 see the messages above - you need to update to flutter_image 2.0.0

@tvolkert how can I update though? just updated to v1.7.8+hotfix.3 and got this error message.

Ah, just noticed that flutter_svg has newer version (v0.13.0). And upgrading to this version fixes the issue. Haven't noticed the newer version because it was hidden under ellipses here https://github.com/dnfield/flutter_svg/releases. Strange that GitHub hides the latest versions. What for?? It's weird..

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2019

@andrewsdv the version is picked up from Pub, not Github -- https://pub.dev/packages/flutter_svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.