skip to Main Content

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:flutterpackagesflutter_toolsgradleflutter.gradle’ line: 1151

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

Process ‘command ‘C:flutterbinflutter.bat” finished with non-zero exit value 1

[enter image description here](https://i.stack.imgur.com/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 :

2

Answers


  1. Chosen as BEST ANSWER

    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


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search