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.
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.
Related
I upgrade flutter from 2.5 to 2.8 and when I run the app I get the following errors:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5943:25: Error: Member not found: 'six_ft_apart'.
'six_ft_apart': Icons.six_ft_apart,
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5944:31: Error: Member not found: 'six_ft_apart_sharp'.
'six_ft_apart_sharp': Icons.six_ft_apart_sharp,
^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5945:33: Error: Member not found: 'six_ft_apart_rounded'.
'six_ft_apart_rounded': Icons.six_ft_apart_rounded,
^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/inspireui-1.0.9/lib/icons/material.dart:5946:34: Error: Member not found: 'six_ft_apart_outlined'.
'six_ft_apart_outlined': Icons.six_ft_apart_outlined,
^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/scale.dart:32:11: Error: No named parameter with the name 'delta'.
delta: delta,
^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/scale.dart:339:43: Error: Too few positional arguments: 2 required, 1 given.
focalPointDelta > computePanSlop(pointerDeviceKind))
^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2116:8: Context: Found this candidate, but the arguments don't match.
double computePanSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:46:66: Error: Too few positional arguments: 2 required, 1 given.
final double minDistance = minFlingDistance ?? computeHitSlop(kind);
^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:54:55: Error: Too few positional arguments: 2 required, 1 given.
return _globalDistanceMoved.abs() > computeHitSlop(pointerDeviceKind);
^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:101:66: Error: Too few positional arguments: 2 required, 1 given.
final double minDistance = minFlingDistance ?? computeHitSlop(kind);
^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/extended_image-5.1.3/lib/src/gesture_detector/drag.dart:109:55: Error: Too few positional arguments: 2 required, 1 given.
return _globalDistanceMoved.abs() > computeHitSlop(pointerDeviceKind);
^
/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart:2103:8: Context: Found this candidate, but the arguments don't match.
double computeHitSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\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 1m 10s
Exception: Gradle task assembleDebug failed with exit code 1
From what I could figure out, they have renamed six_ft_... to six__ft_..., notice the double underscore.
Until they fix it, you can change it manually in your local copy of the package.
The other ones that don't work, just delete them too.
when I upgrade my flutter to 2.8 , it just need to download cmdline-tools from android sdk manager tools.
if you still didn't download it , try to download it.
then
add android-sdk/tools path to the environment
best of luck
When you change between flutter versions, there may be breaking changes, which is the case here.
You may need to upgrade some dependencies of your project, go through each dependency, open them on pub.dev, read the changelog to see what changed and if they have upgraded to support newer flutter versions. Notice that not all dependencies may have issues, but some may.
For instance, extended_image: 5.1.3 stopped working on Flutter version 2.8, cause issues like yours above. So if you upgrade extended_image to v6.0.0, the issue goes away.
You should either move back on a flutter version with flutter downgrade v2.5.3, to whichever version works for you, or check your dependencies.
I cloned an app from a git hub repo and when I ran it on my system, it shows this error.
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.3/lib/src/picture_provider.dart:56:45: Error: Method not found: 'Localizations.maybeLocaleOf'.
locale: context != null ? Localizations.maybeLocaleOf(context) : null,
^^^^^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.3/lib/src/picture_provider.dart:57:53: Error: Method not found: 'Directionality.maybeOf'.
textDirection: context != null ? Directionality.maybeOf(context) : null,
^^^^^^^
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.
Here is the snap of the flutter doctor -v
Flutter doctor console snapshot
It keeps showing this error that flutter and dart plugins are not installed. If you could also provide a solution to that or is it that there is some issue with the latest version of flutter?
Please if someone could help!
The error in flutter doctor is normal, everything works despite those two errors.
Did you run flutter pub get after cloning your project?
The error is also specifically telling you to go to the file: 'lib/src/picture_provider.dart'
then go to line #57 and in column 53 there is that error. It might be an outdated package or something incompatible with null-safety.
take a look at this similar question.
So I decided to upgrade the flutter to the latest stable version 2, I used flutter clean then after the flutter upgrade, I kept getting this error intl version dependency
PS D:\Flutter\flutter-app> flutter run
Because fstore depends on flutter_localizations any from sdk which depends on intl 0.17.0, intl 0.17.0 is required.
So, because fstore depends on intl ^0.16.1, version solving failed.
Running "flutter pub get" in flutter-app...
pub get failed (1; So, because fstore depends on intl ^0.16.1, version solving failed.)
so after changing the dependency to
dependency_overrides:
intl: 0.17.0
I started getting these errors, before the clean build and upgrade everything was working fine
PS D:\Flutter\codecanyon-8n5MtXRZ-fluxstore-woocommerce-flutter-ecommerce-full-app> flutter run
Launching lib\main.dart on SM N950F in debug mode...
lib/widgets/firebase/firebase_cloud_messaging_wapper.dart:32:24: Error: The method 'configure' isn't defined for the class 'FirebaseMessaging'.
- 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart' ('../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.15/lib/firebase_messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'configure'.
_firebaseMessaging.configure(
^^^^^^^^^
lib/widgets/firebase/firebase_cloud_messaging_wapper.dart:42:24: Error: The getter 'onIosSettingsRegistered' isn't defined for the class 'FirebaseMessaging'.
- 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart' ('../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.15/lib/firebase_messaging.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'onIosSettingsRegistered'.
_firebaseMessaging.onIosSettingsRegistered
^^^^^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:64:14: Error: Not a constant expression.
case AuthorizationStatus.authorized:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:64:14: Error: 'AuthorizationStatus' is imported from both 'package:apple_sign_in/apple_sign_in.dart' and 'package:firebase_messaging_platform_interface/src/types.dart'.
case AuthorizationStatus.authorized:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:86:14: Error: Not a constant expression.
case AuthorizationStatus.error:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:86:14: Error: 'AuthorizationStatus' is imported from both 'package:apple_sign_in/apple_sign_in.dart' and 'package:firebase_messaging_platform_interface/src/types.dart'.
case AuthorizationStatus.error:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:89:14: Error: Not a constant expression.
case AuthorizationStatus.cancelled:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:89:14: Error: 'AuthorizationStatus' is imported from both 'package:apple_sign_in/apple_sign_in.dart' and 'package:firebase_messaging_platform_interface/src/types.dart'.
case AuthorizationStatus.cancelled:
^^^^^^^^^^^^^^^^^^^
lib/screens/home/onboard_screen.dart:207:19: Error: No named parameter with the name 'enableSlideIcon'.
enableSlideIcon: true,
^^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/liquid_swipe-2.0.1/lib/liquid_swipe.dart:211:9: Context: Found this candidate, but the arguments don't match.
const LiquidSwipe({
^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/extended_image-2.0.0/lib/src/extended_image.dart:786:44: Error: No named parameter with the name 'nullOk'.
_invertColors = MediaQuery.of(context, nullOk: true)?.invertColors ??
^^^^^^
../Flutter_SDK/packages/flutter/lib/src/widgets/media_query.dart:818:25: Context: Found this candidate, but the arguments don't match.
static MediaQueryData of(BuildContext context) {
^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/wave-0.1.0/lib/config.dart:46:13: Error: Method not found: 'throwNullError'.
throwNullError('custom', 'colors` or `gradients');
^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/wave-0.1.0/lib/config.dart:60:13: Error: Method not found: 'throwNullError'.
throwNullError('custom', 'durations');
^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/wave-0.1.0/lib/config.dart:66:13: Error: Method not found: 'throwNullError'.
throwNullError('custom', 'heightPercentages');
^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/stripe_sdk-4.0.2/lib/src/models/card.dart:55:38: Error: Too few positional arguments: 2 required, 1 given.
return _ccValidator.validateCVV(cvc, cardType: cardType).isValid;
^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/stripe_sdk-4.0.2/lib/src/models/card.dart:57:38: Error: Too few positional arguments: 2 required, 1 given.
return _ccValidator.validateCVV(cvc).isValid;
^
FAILURE: Build failed with an exception.
* Where:
Script 'D:\Flutter\Flutter_SDK\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\Flutter\Flutter_SDK\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 5m 36s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 342.1s
Exception: Gradle task assembleDebug failed with exit code 1
Any help will be really appreciated.
Run 'flutter pub upgrade' . It'll update your dependencies to play along nicely with each other.
I've installed Flutter without Android Studio following these two tutorials: https://medium.com/#quicky316/install-flutter-sdk-on-windows-without-android-studio-102fdf567ce4 and https://dev.to/ejgamer21/install-flutter-without-android-studio-58bi.
I have connected my phone with USB debugging enabled and I've run flutter doctor: everything seems to be fine (although I haven't configured an IDE yet). Then I've tried to run the "Hello world" example that comes with Flutter using flutter run in the hello_world directory, but I get this error:
lib/main.dart:5:8: Error: Error when reading '/C:/b/s/w/ir/k/archive/flutter/packages/flutter/lib/widgets.dart': Impossibile trovare il percorso specificato.
import 'package:flutter/widgets.dart';
^
lib/main.dart:12:16: Error: Method not found: 'Key'.
key: Key('title'),
^^^
lib/main.dart:13:26: Error: Getter not found: 'TextDirection'.
textDirection: TextDirection.ltr
^^^^^^^^^^^^^
lib/main.dart:11:9: Error: Method not found: 'Text'.
Text('Hello, world!',
^^^^
lib/main.dart:9:11: Error: Method not found: 'Center'.
const Center(
^^^^^^
lib/main.dart:8:3: Error: Method not found: 'runApp'.
runApp(
^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\mpepi\Android\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\mpepi\Android\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 4s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 4,7s
Exception: Gradle task assembleDebug failed with exit code 1
("Impossibile trovare il percorso specificato" means "Couldn't find the specified path")
Something seems to be wrong with the path for the packages, I have located the required file at C:\Users\mpepi\Android\flutter\packages\flutter\lib which of course is different from the one in the first line. I have set all environment variables as the tutorials explain, what am I missing?
Delete in the .vscode file. Restart the flutter application of visual studio code and run 'Flutter run'. It worked for me.
You could try to set "File Transfer" mode on your phone, it usually is on the notification bar if the phone is conected
For some cases I've also faced the similar issue. This problem is likely to arise when flutter doesn't get the packages. It wasn't even getting the material package, like your widget package.
Fix: Go to pubspec.yaml file. Make sure your internet connection is on and working. If you're developing in vscode you'll find buttons at top-right corner. Click Get Packages and wait until flutter downloads the packages.
If you don't find those buttons, then from the command line navigate to the project folder and run flutter pub get or flutter packages get.
I have newly installed Flutter on Android Studio. I had a source code of flutter which I want to open using it. I installed the latest flutter plugin and flutter SDK. But when I try to run the app, it shows me the following error:
Compiler message:
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
PictureStream();
^^^^^^^^^^^^^
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
^
Compiler message:
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
PictureStream();
^^^^^^^^^^^^^
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Flutter SDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Flutter SDK\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 23s
Exception: Gradle task assembleDebug failed with exit code 1
I am completely new to this and have no idea where this error is pointing. I have the latest Flutter SDK version: Flutter 1.17.0 and Dart 2.8.1, it's a stable version. My Android Studio version is 3.6.2
Try executing this in your terminal :
flutter pub cache repair
If it doesn't work, deleting the flutter folder, along with the cache folder should do the job.
In my case i solved this problem adding the latest version of flutter svg to pubspec.yaml
Check the link to install latest version: https://pub.dev/packages/flutter_svg#-installing-tab-