Flutter:目标kernel_snapshot失败

时间:2019-12-13 14:01:32

标签: flutter dart

我已经更新到最新的flutter更新。当我要启动项目时,它返回一个错误。该项目取决于多个存储库,我不知道这是为什么。我尝试了多种解决方案,但它们不能解决错误。希望可以有人帮帮我。谢谢。

我已将Flutter稳定版更新为最新版本:

Upgrading Flutter from /Users/domingo/flutter...
Updating cf37c2cd0..27321ebba
 24 files changed, 651 insertions(+), 218 deletions(-)
Flutter is already up to date on channel stable
Flutter 1.12.13+hotfix.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 27321ebbad (2 days ago) • 2019-12-10 18:15:01 -0800
Engine • revision 2994f7e1e6
Tools • Dart 2.7.0

调试终端完成: https://pastebin.com/2PwktnGT

/Users/domingo/StudioProjects/faycancrm/.dart_tool/flutter_build/e61e4110ac7bd4b7b74855b2fc423272/app.di
ll --depfile
/Users/domingo/StudioProjects/faycancrm/.dart_tool/flutter_build/e61e4110ac7bd4b7b74855b2fc423272/kernel
_snapshot.d package:faycancrm/main.dart
[+2401 ms] [+2478 ms] 
[   +1 ms]            Compiler message:
[        ] [   +3 ms]
../../flutter/.pub-cache/hosted/pub.dartlang.org/zefyr-0.8.0/lib/src/widgets/input.dart:11:7: Error: The
non-abstract class 'InputConnectionController' is missing implementations for these members:
[        ] [        ]  - TextInputClient.connectionClosed
[        ] [        ] Try to either
[        ] [        ]  - provide an implementation,
[        ] [        ]  - inherit an implementation from a superclass or mixin,
[        ] [        ]  - mark the class as abstract, or
[        ] [        ]  - provide a 'noSuchMethod' implementation.
[        ] [        ] class InputConnectionController implements TextInputClient {
[        ] [        ]       ^^^^^^^^^^^^^^^^^^^^^^^^^
[        ] [        ] ../../flutter/packages/flutter/lib/src/services/text_input.dart:661:8: Context:
'TextInputClient.connectionClosed' is defined here.
[        ] [        ]   void connectionClosed();
[        ] [        ]        ^^^^^^^^^^^^^^^^
[ +391 ms] [ +402 ms]
../../flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-1.1.3/lib/src/cached_network_image
_provider.dart:42:24: Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments
than those of overridden method 'ImageProvider.load'.
[        ] [        ]   ImageStreamCompleter load(CachedNetworkImageProvider key) {
[        ] [        ]                        ^
[        ] [        ] ../../flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24:
Context: This is the overridden method ('load').
[        ] [        ]   ImageStreamCompleter load(T key, DecoderCallback decode);
[        ] [        ]                        ^
[+8796 ms] [+8774 ms] Persisting file store
[        ] [  +19 ms] Done persisting file store
[        ] [   +1 ms] Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
[  +97 ms] [  +11 ms] "flutter assemble" took 13.771ms.
[        ] build failed.
[        ] #0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
[        ] #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:183:7)
[        ] <asynchronous suspension>
[        ] #2      FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:615:18)
[        ] <asynchronous suspension>
[        ] #3      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:515:33)
[   +1 ms] <asynchronous suspension>
[        ] #4      AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:146:29)
[        ] #5      _rootRun (dart:async/zone.dart:1126:13)
[        ] #6      _CustomZone.run (dart:async/zone.dart:1023:19)
[        ] #7      _runZoned (dart:async/zone.dart:1518:10)
[        ] #8      runZoned (dart:async/zone.dart:1465:12)
[        ] #9      AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
[        ] #10     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:505:20)
[        ] #11     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
[        ] #12     FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:413:21)
[  +16 ms] <asynchronous suspension>
[        ] #13     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:146:29)
[        ] #14     _rootRun (dart:async/zone.dart:1126:13)
[        ] #15     _CustomZone.run (dart:async/zone.dart:1023:19)
[   +1 ms] #16     _runZoned (dart:async/zone.dart:1518:10)
[        ] #17     runZoned (dart:async/zone.dart:1465:12)
[        ] #18     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
[        ] #19     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:364:19)
[        ] #20     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
[        ] #21     new Future.sync (dart:async/future.dart:224:31)
[        ] #22     CommandRunner.run (package:args/command_runner.dart:112:14)
[        ] #23     FlutterCommandRunner.run
(package:flutter_tools/src/runner/flutter_command_runner.dart:250:18)
[        ] #24     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22)
[        ] #25     _rootRun (dart:async/zone.dart:1126:13)
[        ] #26     _CustomZone.run (dart:async/zone.dart:1023:19)
[        ] #27     _runZoned (dart:async/zone.dart:1518:10)
[        ] #28     runZoned (dart:async/zone.dart:1502:12)
[        ] #29     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
[        ] <asynchronous suspension>
[        ] #30     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:146:29)
[        ] #31     _rootRun (dart:async/zone.dart:1126:13)
[        ] #32     _CustomZone.run (dart:async/zone.dart:1023:19)
[        ] #33     _runZoned (dart:async/zone.dart:1518:10)
[        ] #34     runZoned (dart:async/zone.dart:1465:12)
[        ] #35     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
[        ] #36     runInContext (package:flutter_tools/src/context_runner.dart:64:24)
[        ] #37     run (package:flutter_tools/runner.dart:50:10)
[        ] #38     main (package:flutter_tools/executable.dart:65:9)
[        ] #39     main
(file:///Users/domingo/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
[   +3 ms] #40     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
[        ] #41     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
[        ] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Script '/Users/domingo/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 780
[        ] * What went wrong:
[        ] Execution failed for task ':app:compileFlutterBuildDebug'.
[        ] > Process 'command '/Users/domingo/flutter/bin/flutter'' finished with non-zero exit value 1
[   +3 ms] * 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.
[   +5 ms] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 17s
[        ] > Task :app:compileFlutterBuildDebug FAILED
[        ] 1 actionable task: 1 executed
[ +471 ms] Running Gradle task 'assembleDebug'... (completed in 19,2s)
[   +3 ms] The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to
try using
           Jetfier to solve the incompatibility.
[  +15 ms] ✏️  Creating `android/settings_aar.gradle`...
[   +4 ms] ✏️  Creating `android/settings_aar.gradle`... (completed in 2ms)
[        ] ✓ `android/settings_aar.gradle` created successfully.
[   +3 ms] Building plugin audioplayers...
[   +9 ms] Running Gradle task 'assembleAarRelease'...
[   +2 ms] set `android.enableR8=true` in gradle.properties
[  +26 ms] Using gradle from

1 个答案:

答案 0 :(得分:0)

似乎TextInputClient的界面已更改,Zefyr尚未更新以完全实现新方法(例如,看起来好像缺少了connectionClosed的实现,但the Zefyr source doesn't have an implementation)。

不幸的是,除了:

  • 在GitHub上针对Zefyr存储库提出问题,希望作者能够发布修复程序
  • 在执行了缺少的方法后,请分叉Zefyr并依靠计算机上的本地副本
  • 将Flutter版本降级为Zefyr使用的最新版本
  • 找到另一个提供类似功能的插件