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’.
[enter image description here](https://i.stack.imgur.com/1jpnr.png)Process ‘command ‘C:flutterbinflutter.bat” finished with non-zero exit value 1
- 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 :-
pubspec.yaml
enter image description here -
android/build.gradle
enter image description here -
app/build.gradle
enter image description here
-
2
Answers
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
As can be seen in your linked screenshot, there’s an issue with how
flutter_local_notifications
uses a wrong signature for a class fromflutter_local_notifications_platform_interface
. This is probably a result of invalid version constraints made by the developer in the10.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 is13.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
.