I got an error compiling the package. It seems like an error of the cached_network_image dependency.
Is there any fix?
Using flutter master and compiling for Android.
Launching lib/main.dart on Nexus 5X in debug mode...
Initializing gradle... 14.9s
Resolving dependencies... 75.3s
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on
https://goo.gl/CP92wY.
Compiler message:
../../../.pub-cache/hosted/pub.dartlang.org/flutter_image-2.0.0/lib/network.dart:73:24: Error: The method 'NetworkImageWithRetry.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
ImageStreamCompleter load(NetworkImageWithRetry key) {
^
/opt/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
../../../.pub-cache/hosted/pub.dartlang.org/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) {
^
/opt/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
../../../.pub-cache/hosted/pub.dartlang.org/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) {
^
/opt/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
ImageStreamCompleter load(T key, DecoderCallback decode);
^
../lib/src/layer/tile_provider/mbtiles_image_provider.dart:90:24: Error: The method 'MBTileImage.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
ImageStreamCompleter load(MBTileImage key) {
^
/opt/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:230:7)
<asynchronous suspension>
#1 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:526:25)
<asynchronous suspension>
#2 _BuildInstance.invokeTarget.<anonymous closure> (package:flutter_tools/src/build_system/build_system.dart:481:35)
#3 new Future.sync (dart:async/future.dart:222: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)
<asynchronous suspension>
<asynchronous suspension>
#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:125:48)
#10 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#11 buildWithAssemble (package:flutter_tools/src/bundle.dart:99: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 BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:126:25)
#16 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#17 BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:97:42)
#18 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:557:18)
#19 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#20 _rootRunUnary (dart:async/zone.dart:1132:38)
#21 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#23 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#24 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#25 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#26 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#27 _rootRun (dart:async/zone.dart:1124:13)
#28 _CustomZone.run (dart:async/zone.dart:1021:19)
#29 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#30 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#31 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#32 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#33 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#34 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
Failed to build bundle.
FAILURE: Build failed with an exception.
* Where:
Script '/opt/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 794
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugArm64'.
> Process 'command '/opt/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 15s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 16.0s
Gradle task assembleDebug failed with exit code 1
this is a problem cached_network_image with Flutter 1.10 version as mentioned in this README https://github.com/renefloor/flutter_cached_network_image
can we update the flutter_cached_network_image to 2.0.0-rc version?
Anyone knows about this error? Do you have solution?
Anyone knows about this error? Do you have solution?
you can downgrade flutter version with the command flutter version v1.10.14
Same error here, unfortunately downgrading flutter is not an option for me
use this in pubspec.yaml:
dependencies:
flutter:
sdk: flutter
...
flutter_map:
git:
url: git://github.com/okaxaki/flutter_map.git
ref: fix/support-flutter-1.10
The upstream breaking change has now made it to the beta channel.
@fpv999 can you please elaborate on your answer. It works, but I would like to know why. Thx mate!!
@supertrens it's using different fork of the library, from someone who already fixed the issue on his fork.
Oh thx! I am asking why not PR the branch to the main lib? Anyways, Glad to find and learn this trick
The stable channel is now incompatible with this plugin.
While we wait for #455 to be merged in flutter_map and released, you can use this in your pubspec.yaml as said earlier by @fpv999
flutter_map:
git:
url: git://github.com/okaxaki/flutter_map.git
ref: fix/support-flutter-1.10
# I had issues with flutter_map_marker_cluster saying it cannot depends from hosted while coming from git...
flutter_map_marker_cluster:
git:
url: git://github.com/emidiao/flutter_map_marker_cluster.git
ref: e1b4ad9c6d300649acd448a9ba9069d865845686
This should be fixed in 0.8.0
Most helpful comment
use this in pubspec.yaml: