-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Comments
This might be related to Dart 2.3.0 version bump, here you can find a temporary workaround for |
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! |
For me 4 to 5 Plugins are failing with the same errors.
This issue has to be solved asap. Thanks |
I have gotting the same errors with 2 libs with same issue.
This issue should be solved asap. |
The root cause is #30983. The change to
|
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 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. |
We can change the type of context from |
flutter_svg has been fixed. Let me know if you are still having issues with it. |
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
|
So what is the temporary work around for now? |
@vijayawoshe Users of a plugin broken by this can probably work around it quickest by switching to The fix for plugins authors is to update their code to work on both |
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 |
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) |
@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. |
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. |
Oh thanks for the response. 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 |
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? |
if no-one used master - who would detect these issues? :) |
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. |
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'). channel : stable Thanks |
Same issue for Flutter 1.7.8+hotfix.3 Compiler message: 'StringBuffer' is from 'dart:core'. on stable channel version Thanks |
@puneetsdsharma65 see the messages above - you need to update to flutter_image 2.0.0 |
Compiler message:
How can I solve this? |
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'. |
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 |
|
@tvolkert how can I update though? just updated to v1.7.8+hotfix.3 and got this error message. |
@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 |
The same to me. How to solve this issue?? |
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.. |
@andrewsdv the version is picked up from Pub, not Github -- https://pub.dev/packages/flutter_svg |
Guys I am completely stuck after upgrading to the 1.7.8+hotfix.3 I have been unable to compile in iOS. I have tried downgrading back to 1.5 but the error is still there. I have tried creating a new project and just once it managed to compile to the simulator. After that its been giving me nightmares. Please please. When is this issue going to be resolved. We are dealing with tight timelines for my clients projects. I am now at an advanced stage of the project. Please I need a resolution to this. This is severe. |
My fix for this was to update the flutter_svg to |
Same issue for Flutter 1.7.8+hotfix.4 Compiler message:
FAILURE: Build failed with an exception.
BUILD FAILED in 24s |
@CarrieUp have you tried updating your dependency on |
Running into the same issue as well. Looks like I just need to update my dependencies. New to this so thanks for any help! Compiler message: Compiler message:
|
@kawynsean your problem is originating from |
Yes.... This was all I needed! |
This issue has been moved to firebase/flutterfire#385. Any further collaboration will be done there. |
* Update analysis options * Clean up analysis errors * Update/fix broken API calls flutter/flutter#31962
This comment was marked as spam.
This comment was marked as spam.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
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:
Steps to Reproduce
Added pubspec dependency
attempt to build the project.
Logs
The text was updated successfully, but these errors were encountered: