-
-
Notifications
You must be signed in to change notification settings - Fork 672
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 method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load' #270
Comments
Please see the readme on the frontpage (https://github.com/renefloor/flutter_cached_network_image) |
I have same problem~ |
@DLErice So did you read the frontpage? You can download 2.0.0-rc and everything should work fine. Or just use the stable channel of Flutter.... |
@renefloor when will this issue will be resolved ? |
It is already solved, you just need to use 2.0.0-rc. I won't make it a stable version as long as it is only usable on master and maybe not even until flutter hits stable. This change in flutter is a breaking change, so I can never make it backwards compatible. |
@renefloor thanks for clarifying the doubt ! |
How would I upgrade to cached_network_image v2.0.0-rc ?
|
@maylortaylor I just tried on beta, which is on 1.10.7, but at that version cached_network_image 1.1.2 should still work. Do you have any issues with that version? |
@renefloor Looks like the breaking change has rolled out to dev channel, I just created CI build to confirm: #283 |
@renefloor I have a project that currently has to target on flutter dev channel because of a hard dependency on its FFI features, and it's really annoying that breaking changes on ImageProvider APIs are introduced. I would suggest separating out the ImageProvider API as a standalone package to make the widget api work for all channels, what do you think? |
@hanabi1224 It could be a solution, but I'm afraid many people won't understand what is the difference between the two and will complain that they can't use it while they actually need to other package. We just have to go through this phase of having 2 incompatible versions. Do you also need to build the same app on more stable flutter channels? Otherwise you can just use version 2.0.0 right? |
@renefloor I only need to build against flutter dev (currently 1.10.15) however 2.0.0-rc.1 does not work for me (The same error may come from some other packages tho, I will take another look to confirm) : ( |
I just upgraded to 1.11.0 beta release and then also faced the "the method 'networkImageWithRetry.load' has fewer positional arguments..." error. Unfortunately 2.0.0-rc.1 does not solve the problem. Anything I can try? Thanks :) |
had this bug too today |
It's not working with the current stable release, 1.12.13+hotfix.5. Any news on this issue? |
I just used 2.0.0-rc for now. |
|
Worked for me with 2.0.0-rc |
For now it worked for me with 2.0.0-rc with latest flutter 1.12 |
Also, it worked for me with 2.0.0-rc with latest flutter 1.12 Modifed on pubspec.lock: added on dev_dependencies, pubspec.yaml: |
For mee too it worked 2.0.0-rc with latest flutter 1.12 |
Had the same problem, after reading the README file, everything was fine again, I can proceed. Running flutter doctor... |
I solved it perfectly after upgrading to cached_network_image: ^2.0.0-rc. |
Well this got a lot of traction. Worked fine after upgrading to 2.0.0-rc and the new stable version of flutter (1.12). I guess the Flutter team was right for one thing. The community is beyond great! |
It's worked for me at Flutter: 1.12.13+hotfix.5. Thanks |
Download and reinstall the flutter sdk |
[note My Flutter: 1.12.13+hotfix.5 ] |
[note My Flutter: 1.12.13+hotfix.5 ] |
solution : |
SolutionYou're right, the problem is described in this post https://pub.dev/documentation/cached_network_image/latest/ Breaking change with ImageProvider.load in Flutter 1.10 https://pub.dev/packages/cached_network_image/versions/2.0.0-rc.1#-installing-tab- |
What should I pass to second parameter of CachedNetworkImageProvider.load? |
I updated the Flutter to latest today and got this error and read the repo readme and act on it. Everything works fine now thanks to package owner Rene Floor Just increment the package in
By package owner:
|
Since we're at 1.12+ on stable, can 2.0rc be released as a regular version, @renefloor ? |
@renefloor |
i have same proble this type,.,, anyone can give me solution |
@deepkachchhawah do you use version 2.0.0 or 1.x? It should be fixed in 2.0.0 |
By adding DecoderCallback decode as second argument fix the problem. Upgrade to lastest. @OverRide |
2.0.0-rc worked like a charm... Thanks alot |
I have read but nothing special there what exactly is nouveau there? or significantly different from the actual implementation example given given here https://pub.dev/packages/cached_network_image |
for me it's not working on the current latest stable release of Flutter which is at the time of this posting 1.17.2 |
@Chimba123 which version of CachedNetworkImage are you using and what's the exact error you get? |
I have just updated to cached_network_image: ^2.0.0-rc in the pubspec. The problem is that the placeholder in the CachedNetworkImage widget is not being replaced by the loaded images from the network it was working before but its just stuck on the loader or the blur hash this is my code: the blur hash widget is not fading out to show the loaded state/images |
then I am also getting this error: [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider) |
The placeholder is just stuck there... even though the state is loaded as shown by the bloc in the console as below: flutter: onTransition Transition { currentState: SocialsFeedLoading, event: FetchSocialsFeed, nextState: SocialsFeedLoaded } The last state is "SocialsFeedLoaded" and the model is loaded but the data is not being shown in the CacheNetwrokImage .. but it used too previously before the upgrade |
But that has nothing to do with "The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'", so why do you post here as if you have this issue? |
@renefloor > I have just updated to cached_network_image: ^2.0.0-rc in the pubspec I did that just a few minutes ago and that specific error is gone but the issue of the plugin not working remains after doing what you suggested |
When I use the latest version of flutter, the following error will be reported when I introduce this library
Compiler message:
../../../../macLib/flutter/.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-1.1.2+1/lib/src/cached_network_image_provider.dart:53:24: Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of
overridden method 'ImageProvider.load'.
ImageStreamCompleter load(CachedNetworkImageProvider key) {
^
../../../../macLib/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
../../../../macLib/flutter/.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-1.1.2+1/lib/src/scaled_file_image.dart:45:24: Error: The method 'ScaledFileImage.load' has fewer positional arguments than those of overridden method
'ImageProvider.load'.
ImageStreamCompleter load(ScaledFileImage key) {
^
../../../../macLib/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
Exception: Errors during snapshot creation: null
#0 KernelSnapshot.build (package:flutter_tools/src/build_system/targets/dart.dart:225:7)
#1 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:526:25)
#2 _BuildInstance.invokeTarget. (package:flutter_tools/src/build_system/build_system.dart:481:35)
#3 new Future.sync (dart:async/future.dart:224:31)
#4 AsyncMemoizer.runOnce (package:async/src/async_memoizer.dart:43:45)
#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:481:21)
#6 BuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:419:36)
#7 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#8 BuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:400:28)
#9 buildWithAssemble (package:flutter_tools/src/bundle.dart:122:48)
#10 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#11 buildWithAssemble (package:flutter_tools/src/bundle.dart:98:31)
#12 BundleBuilder.build (package:flutter_tools/src/bundle.dart:75:11)
#13 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#14 BundleBuilder.build (package:flutter_tools/src/bundle.dart:52:21)
#15 IOSSimulator._sideloadUpdatedAssetsForInstalledApplicationBundle (package:flutter_tools/src/ios/simulators.dart:453:28)
#16 IOSSimulator._setupUpdatedApplicationBundle (package:flutter_tools/src/ios/simulators.dart:420:11)
#17 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#18 IOSSimulator._setupUpdatedApplicationBundle (package:flutter_tools/src/ios/simulators.dart:419:46)
#19 IOSSimulator.startApp (package:flutter_tools/src/ios/simulators.dart:352:15)
#20 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#21 IOSSimulator.startApp (package:flutter_tools/src/ios/simulators.dart:339:32)
#22 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:380:54)
#23 _asyncThenWrapperHelper. (dart:async-patch/async_patch.dart:71:64)
#24 _rootRunUnary (dart:async/zone.dart:1132:38)
#25 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#26 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#27 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#28 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#29 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#30 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#31 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#32 BuildableIOSApp.fromProject (package:flutter_tools/src/application_package.dart)
#33 _asyncThenWrapperHelper. (dart:async-patch/async_patch.dart:71:64)
#34 _rootRunUnary (dart:async/zone.dart:1132:38)
#35 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#36 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#37 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#38 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#39 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#40 Future._asyncComplete. (dart:async/future_impl.dart:552:7)
#41 _rootRun (dart:async/zone.dart:1124:13)
#42 _CustomZone.run (dart:async/zone.dart:1021:19)
#43 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#44 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
#45 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#46 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#47 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#48 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
This is my version of Flutter:
Flutter 1.10.15-pre.166 • channel master • https://github.com/flutter/flutter.git
Framework • revision 1781d5c9bb (18 minutes ago) • 2019-10-17 19:22:47 -0700
Engine • revision 508146f0de
Tools • Dart 2.6.0 (build 2.6.0-dev.8.0 f020ce5d23)
The text was updated successfully, but these errors were encountered: