fucukur
fucukur

Reputation: 373

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null build failed

I have updated to the latest flutter update. When I want to start the project, it returns an error. The project depends on several repositories and I don't know if that is why. I have tried multiple solutions but they do not solve the error. Hope someone can help me. thanks.

Compiler message:

/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

Upvotes: 15

Views: 50228

Answers (2)

griffins
griffins

Reputation: 8256

i found this issue issue TL:DR here is a summary

It looks like your local engine build flutter/engine and framework + tool flutter/flutter are out of sync: You're using an engine from when after SemanticsFlag.isLink was added, but a framework/tool from before it rolled into the framework.

You need to ensure that you're using compatible engines and frameworks. In this case, you need to either update flutter/flutter to a newer version or roll back flutter/engine to an older version.

Upvotes: 10

kavita chowdhary
kavita chowdhary

Reputation: 11

import 'package:food_ecommerce/pages/flutter/packages/flutter/lib/cupertino.dart';
import 'package:food_ecommerce/pages/flutter/packages/flutter/lib/widgets.dart';

Delete such headers in my case I delete these two headers and my program runs.

Upvotes: 1

Related Questions