Flutter Cannot Compile Due to Source Code Error

Viewed 289

When I try to run the app on the emulator I get this error saying there is something wrong with the... Flutter source code I guess... I tried pub get and pub upgrade, uninstalling the plugins and installing them again, deleting the Flutter files and extracting them again but nothing worked. Thank you!

/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/pull_to_refresh-1.6.4/lib/src/smart_refresher.dart:434:9: Error: No named parameter with the name 'keyboardDismissBehavior'.
        keyboardDismissBehavior:
        ^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/flutter/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match.
  const CustomScrollView({
        ^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

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

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

BUILD FAILED in 33s
Exception: Gradle task assembleDebug failed with exit code 1
2 Answers

You can run :

flutter clean

flutter pub get

I think the problem may be in your version of Flutter. Please try and run flutter doctor -v. If it works, then add the result in the question and we will be able to find the error. If it doesn't work, then try reinstalling your flutter.

Related