0
votes

While building and running the Flutter mobile application with flutter --version

Flutter 2.0.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision c5a4b4029c (3 days ago) • 2021-03-04 09:47:48 -0800 Engine • revision 40441def69 Tools • Dart 2.12.0

I am getting the below error.

Launching lib/main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... /Applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dart:83:7: Error: No named parameter with the name 'resizeToAvoidBottomPadding'. resizeToAvoidBottomPadding: false, ^^^^^^^^^^^^^^^^^^^^^^^^^^ /Applications/Flutter/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match. const Scaffold({ ^^^^^^^^ /Applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dart:276:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.

  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/Applications/Flutter/flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. context.inheritFromWidgetOfExactType(_ChewieControllerProvider) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /Applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.0.0+1/lib/src/chewie_player.dart:101:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/Applications/Flutter/flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /Applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.0/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^ /Applications/Flutter/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match. static Locale localeOf(BuildContext context) { ^^^^^^^^

FAILURE: Build failed with an exception.

  • Where: Script '/Applications/Flutter/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991

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

Process 'command '/Applications/Flutter/flutter/bin/flutter'' 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 39s Exception: Gradle task assembleDebug failed with exit code 1

On running flutter doctor no errors are shown. Based on some references even tried switching the flutter channel to beta, master, and dev but the issue still occurs. With the downgrade of the flutter version as well, I am unable to resolve this. The application was working well before and all of sudden this happened.

Please help me in resolving this. Thanks.

1

1 Answers

1
votes

As far as I assume, one of your package causing the problem, I think It's chewie_player.Try using latest version of it, Go to pub dev, and copy the dependence, paste it in .yaml file in place of older dependence.