This afternoon - out of the blue - my Flutter app is no longer running on Chrome
I get the following error...
Waiting for connection from debug service on Chrome...
../../sdk/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/browser_client.dart:56:7: Error: The getter 'completert' isn't defined for the class 'BrowserClient'.
- 'BrowserClient' is from 'package:http/src/browser_client.dart' ('../../sdk/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/browser_client.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'completert'.
completert.complete(StreamedResponse(
^^^^^^^^^^
Failed to compile application.
Any suggestions?
Fixed by downloading an installing the latest DART build
i even done that but errors are still there. i tried to downgrade the flutter version sdk to that project but didn't find the specific version and the ones i found are not helping.
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_circular_chart-0.1.0/lib/src/animated_circular_chart.dart:122:36: Error: Couldn't find constructor 'TypeMatcher'.
.ancestorStateOfType(const TypeMatcher\<AnimatedCircularChartState\>());
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_circular_chart-0.1.0/lib/src/animated_circular_chart.dart:122:10: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'.
.ancestorStateOfType(const TypeMatcher\<AnimatedCircularChartState\>());
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_circular_chart-0.1.0/lib/src/animated_circular_chart.dart:221:60: Error: The getter 'body2' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body2'.
widget.labelStyle ?? Theme.of(context).textTheme.body2;
^^^^^
Failed to compile application.
So i downloaded this flutter project from github that was 3 years old so it was deprecated version, i fix the deprecated version error by following the documentation. now that error is fixed but after that i'm getting these errors above. i have tried so many things like pub upgrade, pub outdated and most of the commands like this but the error are still there. I somewhere read to add override dependencies: "dependency_overrides:
charts_flutter:
git:
url: https://github.com/google/charts
path: charts_flutter"
when running flutter pub run build_runner build I get this error.
Failed to build build_runner:build_runner:
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.
- 'TargetKind' is from 'package:meta/meta_meta.dart' ('../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart').
Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
var kindNames = kinds.map((kind) => kind.displayString).toList()
^^^^^^^^^^^^^
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:1950:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members.
String get displayString {
^^^^^^^^^^^^^
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/src/error/best_practices_verifier.dart:260:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List<dynamic>'.
- 'List' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'.
var validKinds = kindNames.commaSeparatedWithOr;
This issue is related to outdated dependencies most likely, I had a similar one just today.
Run flutter pub upgrade and it should work!
Those who are experiencing this problem, just overwrite the "meta" dependency.
just add these lines to pubspec.yaml
dependency_overrides:
meta: 1.6.0
This might solve your issue, and there is well discussed github discussion https://github.com/dart-lang/sdk/issues/46687
I am getting the following error run project in my vscode debug console after flutter upgrade v3.13:
Invalid depfile: C:\Users\DIMAS\FlutterCode\skip\.dart_tool\flutter_build\35269fa8986c9ee7a9c97697217003ec\kernel_snapshot.d
Invalid depfile: C:\Users\DIMAS\FlutterCode\skip\.dart_tool\flutter_build\35269fa8986c9ee7a9c97697217003ec\kernel_snapshot.d
Error: Could not resolve the package 'characters' in 'package:characters/characters.dart'.
/C:/src/flutter/packages/flutter/lib/src/material/text_field.dart:9:8: Error: Not found: 'package:characters/characters.dart'
import 'package:characters/characters.dart';
^
/C:/src/flutter/packages/flutter/lib/widgets.dart:18:1: Error: Not found: 'package:characters/characters.dart'
export 'package:characters/characters.dart';
^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:10:8: Error: Not found: 'package:characters/characters.dart'
import 'package:characters/characters.dart';
^
/C:/src/flutter/packages/flutter/lib/src/services/text_formatter.dart:9:8: Error: Not found: 'package:characters/characters.dart'
import 'package:characters/characters.dart';
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^
/C:/src/flutter/packages/flutter/lib/src/material/text_field.dart:822:61: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
int get _currentLength => _effectiveController.value.text.characters.length;
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/material/text_field.dart:824:118: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
bool get _hasIntrinsicError => widget.maxLength != null && widget.maxLength > 0 && _effectiveController.value.text.characters.length > widget.maxLength;
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:244:64: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
assert(obscuringCharacter != null && obscuringCharacter.characters.length == 1),
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:361:35: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
assert(value != null && value.characters.length == 1);
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:567:11: Error: 'Characters' isn't a type.
final Characters remaining = string.characters.skipWhile((String currentString) {
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:567:41: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
final Characters remaining = string.characters.skipWhile((String currentString) {
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:600:47: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
for (final String currentString in string.characters) {
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/rendering/editable.dart:602:40: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
!_isWhitespace(currentString.characters.first.toString().codeUnitAt(0))) {
^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(properties);
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
- 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
ifPresent: _completer?.toStringShort(),
^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(description);
^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_formatter.dart:355:11: Error: 'CharacterRange' isn't a type.
final CharacterRange iterator = CharacterRange(value.text);
^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_formatter.dart:355:37: Error: Method not found: 'CharacterRange'.
final CharacterRange iterator = CharacterRange(value.text);
^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_formatter.dart:356:20: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
if (value.text.characters.length > maxLength) {
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_formatter.dart:375:61: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
if (maxLength != null && maxLength > 0 && newValue.text.characters.length > maxLength) {
^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_formatter.dart:378:25: Error: The getter 'characters' isn't defined for the class 'String'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'characters'.
if (oldValue.text.characters.length == maxLength) {
^^^^^^^^^^
Unhandled exception:
FileSystemException(uri=org-dartlang-untransla
table-uri:package%3Acharacters%2Fcharacters.dart; message=StandardFileSystem only supports file:* and data:* URIs)
[38;5;248m#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)[39;49m
[38;5;248m#1 asFileUri (package:vm/kernel_front_end.dart:659:37)[39;49m
[38;5;248m#2 writeDepfile (package:vm/kernel_front_end.dart:853:21)[39;49m
<asynchronous suspen
sion>
[38;5;248m#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:574:15)[39;49m
[38;5;244m<asynchronous suspension>[39;49m
#4 _FlutterFrontendCompiler.compile (packa
ge:flutter_frontend_server/server.dart:43:22)
[38;5;248m#5 starter (package:flutter_frontend_server/server.dart:182:27)[39;49m
#6 main (file:///C:/b/s/w/ir/cache/builder/src/flut
ter/flutter_frontend_server/bin/starter.dart:9:30)
[38;5;244m#7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)[39;49m
#8 _RawReceivePortImpl
._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
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 57s
Exception: Gradle task assembleDebug failed with exit code 1
its seems missing character.dart and some gradle stuff, but i couldn't find exact problem and answer for now on google,
But if i make and run a new project it doesn't have any error, herewith my pubspec.yaml (i've compared old & new project pubspec.yaml there is no significant different exept for additional package):
It looks like you’re missing characters package in your pubspec.yaml.
Make sure it is there and your pubspec is formatted properly. And run flutter pub get again.
If this fails, you should run flutter pub cache repair
Had the same issue.
In pubspec.yaml just execute flutter pub get and flutter pub upgrade.
Then in the root directory terminal execute flutter clean and it will run without problems.
I have had similar issue on my flutter application after I updated the flutter SDK.
What solved my issue were to do the following.
Open a terminal (CMD) navigate to your flutter project, where the pubspec.yaml is. Run the following commands:
Solution
flutter pub get
flutter pub upgrade
After that if you still have issues you can run the flutter pub cache repair, however the
flutter clean
did the trick for me and fixed the issue.
I restarted both visual studio and the AVD virtual device, to be sure
to have a fresh restart.
What tools and software I use:
Visual Studio Code 1.47.3
Android Studio 4.0.1 (Android Virtual Device)
Flutter 1.20.1 (Release date 6.8.2020)
Dart 2.9.0
after refresh the flutter pub get, i've had error SVG problem and i update flutter_svg: ^0.17.4 to flutter_svg: ^0.18.0 it solved SVG problem,
I've ran into this issue a couple times after running flutter upgrade on a new flutter release. In my case, the solution had nothing to do with the error. Just outdated dependencies.
I first did flutter clean (IntelliJ/Android Studio from the tools>Flutter>Flutter clean.)
Updated my pubspec.yaml dependencies to their latest version and ran flutter pub upgrade
Finished! Now you should be able to build and run
try in terminal
$ flutter clean
after
$ flutter doctor
that should solve your issue
I faced the same issue, after deleting the .dart_tool directory/folder and running the application again, the problem solved
Yes! Many people are getting this as the kotlin version and build SDK versions are not in line with each other. just do as follow. one can clean this by only flutter pub upgrade after flutter pub cache repair but once for all I will suggest to follow as below.
flutter clean
flutter pub get
flutter pub cache repair
flutter pub upgrade
done! Happy Coding.
my previous project I used flushbar plugin without any error. but my new project when try to use flushbar i got error..
Project is working well without flushbar.
full error message
Compiler message:
file:///Users/bhanukaisuru/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.7.0/lib/flushbar.dart:207:3: Error: Type 'FocusAttachment' not found.
FocusAttachment _focusAttachment;
^^^^^^^^^^^^^^^
file:///Users/bhanukaisuru/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.7.0/lib/flushbar.dart:207:3: Error: 'FocusAttachment' isn't a type.
FocusAttachment _focusAttachment;
^^^^^^^^^^^^^^^
file:///Users/bhanukaisuru/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.7.0/lib/flushbar.dart:228:35: Error: The method 'attach' isn't defined for the class 'FocusScopeNode'.
- 'FocusScopeNode' is from 'package:flutter/src/widgets/focus_manager.dart' ('file:///Users/bhanukaisuru/Documents/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
Try correcting the name to the name of an existing method, or defining a method named 'attach'.
_focusAttachment = _focusNode.attach(context);
^^^^^^
file:///Users/bhanukaisuru/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.7.0/lib/flushbar.dart:239:16: Error: The method 'dispose' isn't defined for the class 'FocusScopeNode'.
- 'FocusScopeNode' is from 'package:flutter/src/widgets/focus_manager.dart' ('file:///Users/bhanukaisuru/Documents/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
Try correcting the name to the name of an existing method, or defining a method named 'dispose'.
_focusNode.dispose();
I tried these four version, but nothing change
flushbar: ^1.3.0
flushbar: ^1.5.3
flushbar: ^1.7.0
flushbar: ^1.6.0
and also I used,
FocusScope.of(context).requestFocus(FocusNode()),
I was facing the same problem after flutter upgrade.
Remove ^ from your pubspec.yaml for now. It should work.
flushbar: 1.5.3
Reference : https://github.com/flutter/flutter/issues/33827