首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >目标kernel_snapshot失败:异常:快照创建过程中出现错误:空构建失败

目标kernel_snapshot失败:异常:快照创建过程中出现错误:空构建失败
EN

Stack Overflow用户
提问于 2019-12-17 15:01:58
回答 3查看 10.1K关注 0票数 4

我已经更新到最新的颤动更新。当我想要启动项目时,它会返回一个错误。这个项目依赖于几个存储库,我不知道这是不是原因。我尝试了多种解决方案,但都不能解决错误。希望有人能帮我。谢谢。

编译器消息:

代码语言:javascript
运行
复制
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/mvvm-0.1.7/lib/view_context_helpers/logical.dart:151:25: Error: The function expression type 'Widget Function(BuildContext, Null, Widget) Function(TValue)' isn't of expected type 'Widget Function(BuildContext, TValue, Widget) Function(TValue)'.

 - 'Widget' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Change the type of the function expression or the context in which it is used.
              selector: (TValue value) =>
                        ^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' 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

BU�LD FAILED in 31s
Finished with error: Gradle task assembleDebug failed with exit code 1
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2019-12-17 18:59:39

我发现了这个问题issue TL:DR这里是一个摘要

看起来你的本地引擎构建颤动/引擎和框架+工具颤动/颤动是不同步的:你使用的是添加了SemanticsFlag.isLink之后的引擎,但在它进入框架之前是一个框架/工具。

你需要确保你使用的是兼容的引擎和框架。在这种情况下,您需要将颤动/颤动更新到较新的版本,或者将颤动/引擎回滚到较旧的版本。42356

票数 2
EN

Stack Overflow用户

发布于 2020-06-03 02:59:34

代码语言:javascript
运行
复制
Solution 1
1.Ensure compatible engines and frameworks. 
2.Update flutter or install flutter to a newer version, 

still issue persists,  Roll back flutter or engine to an older version.

Best solution to fix by time saving but not preferable, please follow 

Solution 2
1. Download latest version flutter sdk and setup.
2. Fix it by creating a new project and copying the code from the old one. 

有关更多详细信息,请参阅以下链接

http://codekhichdi.com/flutter/target-kernel_snapshot-failed-exception-errors-during-snapshot-creation-null

票数 0
EN

Stack Overflow用户

发布于 2020-07-16 14:57:15

此错误也是由于插件/包不兼容而发生的。在你的pubsec.yaml文件中肯定有一些升级到新版本的包,而你仍然在使用它的旧版本/过时的方法。

因此,您需要用new替换所有不推荐使用的方法。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59369091

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档