3

after I upgrade Flutter version the project accidently throw many errors. and this are errors which I don't understand how to solve.

Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1151

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

[enter image description here](https://i.sstatic.net/1jpnr.png)

  • I tried flutter clean , flutter pub get , flutter pub upgrade
  • Also i tried : distributionUrl=https://services.gradle.org/distributions/gradle-7.5-all.zip _ And also I removed the cache in my C/username/Appdata/local/cache and re run my app => same error
  • tried removing build folder and pubspec.lock and re run . My files which can help to solve my problem :
1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Feb 28, 2023 at 12:33

2 Answers 2

3

Solved ! As can be seen in screenshots that there are some errors of packages (flutter_local_notifications - modal_bottom_sheet )

1 - I deleted cache folder in C/$user_name/AppData/Local/Pub

2 - Updated all packages manually including flutter_local_notifications

3 - Added under dependency_overrides this package

modal_bottom_sheet: git: url: https://github.com/danReynolds/modal_bottom_sheet.git path: modal_bottom_sheet

4 - run flutter clean

5 - run your project successfully

Sign up to request clarification or add additional context in comments.

Comments

1

As can be seen in your linked screenshot, there's an issue with how flutter_local_notifications uses a wrong signature for a class from flutter_local_notifications_platform_interface. This is probably a result of invalid version constraints made by the developer in the 10.0.0-dev.1 prerelease version that you're using.

I would recommend updating the flutter_local_notifications to the latest version (as of the time I'm responding is 13.0.0).

If you can't do that, you can at least update to a stable version. The one you're using is a prerelease version according to semantic versioning. Try version 10.0.0.

3 Comments

It didn't work also. as there is problem with flutter_local_notifications also there is problem with modal_bottom_sheet , but i'm confused about these errors .
I think this has no relation with packages themselves may be there is a conflict or something like that.
You also need to fix the other problem then, too. The kernel_snapshot failure is just a tool failure that results from the Dart compilation failures

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.