Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The following assertion was thrown running a test: 'package:flutter_test/src/binding.dart': Failed assertion: line 567 pos 14: '_pendingExceptionDetails != null' #34499

Closed
Muldec opened this issue Jun 14, 2019 · 45 comments
Labels
a: tests "flutter test", flutter_test, or one of our tests c: crash Stack traces logged to the console customer: crowd Affects or could affect many people, though not necessarily a specific customer. found in release: 3.3 Found to occur in 3.3 found in release: 3.6 Found to occur in 3.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on r: solved Issue is closed as solved

Comments

@Muldec
Copy link

Muldec commented Jun 14, 2019

Steps to Reproduce

(see full code)

  1. Create a widget that contains a button. When the button is pressed show a FutureBuilder and initialize a Future that will throw an exception.
  2. Create a testWidgets that taps the button and override FlutterError.onError to test the exception thrown.
  3. Run the test

Logs

with Future finds exception
YES
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
A test overrode FlutterError.onError but either failed to return it to its original state, or had
unexpected additional errors that it could not handle. Typically, this is caused by using expect()
before restoring FlutterError.onError.
'package:flutter_test/src/binding.dart':
Failed assertion: line 567 pos 14: '_pendingExceptionDetails != null'

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=BUG.md

When the exception was thrown, this was the stack:
#2      TestWidgetsFlutterBinding._runTest.handleUncaughtError (package:flutter_test/src/binding.dart:567:14)
#3      TestWidgetsFlutterBinding._runTest.<anonymous closure> (package:flutter_test/src/binding.dart:572:28)
#18     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:1009:17)
#20     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:997:35)
(elided 32 frames from class _AssertionError, class _FakeAsync, package dart:async, package dart:async-patch, and package stack_trace)

The test description was:
  with Future finds exception
════════════════════════════════════════════════════════════════════════════════════════════════════
00:02  1 -2: C:\Projects\projet_65\mobile_app\test/ui/exception_test.dart: with Future finds exception [E]
  Test failed. See exception logs above.
  The test description was: with Future finds exception

flutter analyze

>flutter analyze
Analyzing project...
No issues found! (ran in 2.1s)

flutter doctor

[√] Flutter (Channel beta, v1.6.3, on Microsoft Windows [Version 10.0.17763.557], locale en-GB)
    • Flutter version 1.6.3 at C:\flutter
    • Framework revision bc7bc94083 (3 weeks ago), 2019-05-23 10:29:07 -0700
    • Engine revision 8dc3a4cde2
    • Dart version 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\az02332\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 36.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2018.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4
    • Flutter plugin version 31.0.3
    • Dart plugin version 182.5124

[√] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.1
    • Flutter plugin version 35.3.3
    • Dart plugin version 191.7221

[√] VS Code (version 1.33.1)
    • VS Code at C:\Users\az02332\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.0.2
@shihaohong shihaohong added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jun 14, 2019
@VladyslavBondarenko
Copy link

Reproduces with current master 1.21.0-6.0.pre.90

flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-6.0.pre.90, on Mac OS X 10.15.6 19G73, locale en-GB)
    • Flutter version 1.21.0-6.0.pre.90 at /Users/nevercode/dev/flutter
    • Framework revision 531ee9452a (85 minutes ago), 2020-07-29 02:26:03 -0400
    • Engine revision 1ba310017c
    • Dart version 2.10.0 (build 2.10.0-1.0.dev 24c7666def)
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.47.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[✓] Connected device (6 available)
    • Redmi Note 7 (mobile)       • 6345c469                                 • android-arm64  • Android 9 (API 28)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 13.6
    • iPhone 11 Pro Max (mobile)  • 55C8466B-5367-492B-8EFE-EC45D980571F     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
    • macOS (desktop)             • macos                                    • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)            • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 84.0.4147.105

• No issues found!

@VladyslavBondarenko VladyslavBondarenko added found in release: 1.21 Found to occur in 1.21 has reproducible steps The issue has been confirmed reproducible and is ready to work on labels Jul 29, 2020
@ivan-horchakov
Copy link

I'm facing such error when the "expect()" fails during running integration tests (migrated from flutter_driver to new API) via CLI command "flutter drive --driver=test_driver/integration_test.dart --target=integration_test/smoke_test.dart" instead of telling what went wrong (I mean "Expected:" and "Actual:"):

[ERROR:flutter/shell/common/shell.cc(210)] Dart Unhandled Exception: 'package:flutter_test/src/binding.dart': Failed assertion: line 754 pos 14: '_pendingExceptionDetails != null': A test overrode
FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle. Typically, this is caused by using expect() before restoring FlutterError.onError.,
stack trace: #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (not installed)
[✓] VS Code (version 1.51.0)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.

@lintdeveloper

This comment was marked as outdated.

@SebghatYusuf

This comment was marked as duplicate.

@ivan-horchakov
Copy link

ivan-horchakov commented Aug 10, 2021

Flutter team, please help us with this problem, because it is not informative and brings much more time to debug integration tests. Also, it is reproducible on the latest stable Flutter:

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] Connected device (2 available)

I/flutter (22828): Another exception was thrown: Expected: exactly one matching node in the widget tree
I/flutter (22828): Another exception was thrown: A test overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle.
Typically, this is caused by using expect() before restoring FlutterError.onError.
I/flutter (22828): Another exception was thrown: A test overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle.
Typically, this is caused by using expect() before restoring FlutterError.onError.
I/flutter (22828): Another exception was thrown: A test overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle.
Typically, this is caused by using expect() before restoring FlutterError.onError.
E/flutter (22828): [ERROR:flutter/shell/common/shell.cc(103)] Dart Unhandled Exception: 'package:flutter_test/src/binding.dart': Failed assertion: line 761 pos 14: '_pendingExceptionDetails != null': A test
overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle. Typically, this is caused by using expect() before restoring
FlutterError.onError., stack trace: #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
E/flutter (22828): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
E/flutter (22828): #2 TestWidgetsFlutterBinding._runTest.handleUncaughtError (package:flutter_test/src/binding.dart:761:14)
E/flutter (22828): #3 TestWidgetsFlutterBinding._runTest. (package:flutter_test/src/binding.dart:766:28)
E/flutter (22828): #4 _CustomZone.handleUncaughtError (dart:async/zone.dart:1241:19)
E/flutter (22828): #5 _CustomZone.runGuarded (dart:async/zone.dart:1164:7)
E/flutter (22828): #6 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1202:23)
E/flutter (22828): #7 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (22828): #8 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter (22828):

@rayliverified
Copy link

Hope the Flutter team can take a look at this issue soon because all errors seem to output the error above instead of the correct error stack.

Trying to do what the error says and resetting FlutterError.onError did not work for me.

FlutterError.onError = (details) => FlutterError.presentError(details);
FlutterError.onError = (_) => null;

@dvagala
Copy link

dvagala commented Sep 15, 2021

On flutter 2.5.0 this seems to be fixed. It no longer gets stuck when running the test. So it continues to execute the rest of the tests. Although it still shows the _pendingExceptionDetails != null error

@Jonas-Sander
Copy link

void main() {
  IntegrationTestWidgetsFlutterBinding.ensureInitialized();

  testWidgets("my test", (WidgetTester tester) async {
    await app.main();
    await tester.pumpAndSettle();
    expect(true, false);
  });
}

This doesn't fail for me but will result in a time out.
If inside our app I don't override FlutterError.onError it fails properly.

This doesn't make any sense to me really. The failure is inside testWidgets, not inside the app. This is really confusing behavior.

@dvagala
Copy link

dvagala commented Sep 16, 2021

@Jonas-Sander is it on flutter 2.5.0? You sample code indeed timed out when I was trying on 2.2.0, but on the 2.5.0 it correctly fails, and move along

@Jonas-Sander
Copy link

Ah yeah I'm still on 2.2.0, got a bit confused with the versions, sorry :)

@woprandi
Copy link
Contributor

Same problem on widget testing, no way to catch a future error with FutureBuilder without fail the test (except if the future is launch during initial build). See #91495

@lhimo
Copy link

lhimo commented Oct 26, 2021

This happens also on integration tests, I think we should add the label

@Artur512
Copy link

It happens on integration tests. Actually its possible to pass only happy path. Any updates?

@being-yash-t
Copy link

being-yash-t commented Dec 16, 2021

Any updates?
Issue persists on Flutter 2.8.0 for us.

@OpenSphereSoftware
Copy link

it helped me to comment out the override of FlutterError.onError in my App

@hattersharath

This comment was marked as outdated.

@ghost

This comment was marked as outdated.

@Tryneeth

This comment was marked as outdated.

@andrewsheridan

This comment was marked as outdated.

@mfurkanyuceal

This comment was marked as outdated.

@Yifei233

This comment was marked as outdated.

@CalebRBPittman

This comment was marked as outdated.

@jrc2139
Copy link

jrc2139 commented Jun 1, 2022

i was struggling with this error (flutter 3.0.1) because i thought maybe an unhandled error was causing this.

however, i fixed it by wrapping the runApp call in the test with runZoneGuarded(() => runApp(MyApp), (e,s) => print('$e\n$s)) 💪

@hananmalka
Copy link

hananmalka commented Jun 1, 2022

@jrc2139 - Unfortunately it doesn't work for me :(
Also with version 3.0.1

@jrc2139
Copy link

jrc2139 commented Jun 1, 2022

@jrc2139 - Unfortunately it doesn't work for me :(
Also with version 3.0.1

you could try adding an isolate to catch an error as well

Isolate.current.addErrorListener(RawReceivePort((pair) async {

final List<dynamic> errorAndStacktrace = pair;

print('${errorAndStacktrace.first}\n${errorAndStacktrace.last}');

}).sendPort);

@hananmalka
Copy link

Isolate.current.addErrorListener(RawReceivePort((pair) async {

final List errorAndStacktrace = pair;

print('${errorAndStacktrace.first}\n${errorAndStacktrace.last}');

}).sendPort);

Where should I put this code?

@huwq1987
Copy link

huwq1987 commented Jun 15, 2022

I found this issue when running integration test on Flutter 3.0.0, and I fixed it like this:

// integration_test/smoke_test.dart

void main() async {
  testWidgets('integration test', (WidgetTester tester) async {
    final FlutterExceptionHandler? originalOnError = FlutterError.onError;
    await runMyApp();
    await tester.pumpAndSettle();
    // reset onError after calling pumpAndSettle()
    FlutterError.onError = originalOnError;

    // ...
  });
}

@akagupta9

This comment was marked as duplicate.

@giridat
Copy link

giridat commented Jun 23, 2022

I fixed the issue by using the "Invalidate Caches..." Option from the File menu drop-down in Android Studio.

@amirmohammadshamss

This comment was marked as duplicate.

@Charlinjoeaht
Copy link

Charlinjoeaht commented Jul 19, 2022

i was struggling with this error (flutter 3.0.1) because i thought maybe an unhandled error was causing this.

however, i fixed it by wrapping the runApp call in the test with runZoneGuarded(() => runApp(MyApp), (e,s) => print('$e\n$s))

Unfortunately this doesn't work for me. I am using Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN)

@Charlinjoeaht
Copy link

Charlinjoeaht commented Jul 19, 2022

I found this issue when running integration test on Flutter 3.0.0, and I fixed it like this:

// integration_test/smoke_test.dart

void main() async {
  testWidgets('integration test', (WidgetTester tester) async {
    final FlutterExceptionHandler? originalOnError = FlutterError.onError;
    await runMyApp();
    await tester.pumpAndSettle();
    // reset onError after calling pumpAndSettle()
    FlutterError.onError = originalOnError;

    // ...
  });
}

Unfortunately this doesn't work for me. I am using Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN)

@kanakapalli
Copy link

I have tried that same with flutter 3.0.4, it seems to be working right.

@kanakapalli
Copy link

I have tried that same with flutter 3.0.4, it seems to be working fine.

@workerbee22
Copy link

Also have this iss on flutter 3.0.5

@fadulalla
Copy link

I'm on 3.0.4 and it's happening. I really don't want to change my main or have different entry points just to appease integration_tests, so as a workaround until the Flutter team fix this, I wrapped expect in my own function which restores onError just before expecting and sets it back to what it was right after:

//file: utils/integration_test_helpers.dart
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';

var _originalOnError;
void initCustomExpect() {
  _originalOnError = FlutterError.onError;
}

// A workaround for: https://github.com/flutter/flutter/issues/34499
void expectCustom(
  dynamic actual,
  dynamic matcher, {
  String reason,
  dynamic skip, // true or a String
}) {
  final onError = FlutterError.onError;
  FlutterError.onError = _originalOnError;
  expect(actual, matcher, reason: reason, skip: skip);
  FlutterError.onError = onError;
}

and then in my integration tests:

import 'utils/integration_test_helpers.dart';

void main() {
  IntegrationTestWidgetsFlutterBinding.ensureInitialized();

  group('end-to-end test', () {
    testWidgets('app loads and home screen is shown', (tester) async {
      // I call this at the top of each test
      initCustomExpect();

      app.main();
      await tester.pumpAndSettle();

      // For the remainder of the test, I just use my custom expect
      expectCustom(find.text('hello'), findsOneWidget);
    });
  });
}

Now the nasty exception is gone and I get the actual exception like how it should be.

@darshankawar
Copy link
Member

Verified this issue on latest stable and master versions using below updated code sample and observed that the error still occurs:

console error log

Testing started at 5:14 PM ...
/Users/dhs/Documents/Fluttersdk/flutter/bin/flutter --no-color test --machine --start-paused test/widget_test.dart

YES
dart:core                                           _AssertionError._throwNew
package:flutter_test/src/binding.dart 903:14        TestWidgetsFlutterBinding._runTest.handleUncaughtError
package:flutter_test/src/binding.dart 908:9         TestWidgetsFlutterBinding._runTest.<fn>
dart:async                                          Future._asyncCompleteError.<fn>
package:fake_async/fake_async.dart 197:32           FakeAsync.flushMicrotasks
package:flutter_test/src/binding.dart 1415:17       AutomatedTestWidgetsFlutterBinding.runTest.<fn>
===== asynchronous gap ===========================
dart:async                                          new Future.microtask
package:flutter_test/src/binding.dart 1402:12       AutomatedTestWidgetsFlutterBinding.runTest
package:flutter_test/src/widget_tester.dart 164:24  testWidgets.<fn>

'package:flutter_test/src/binding.dart': Failed assertion: line 903 pos 14: '_pendingExceptionDetails != null': A test overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle. Typically, this is caused by using expect() before restoring FlutterError.onError.

runnable code sample
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

class MyWidget extends StatefulWidget {
  @override
  _MyWidgetState createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  late Future process;
  bool showFutureBuilder = false;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        ElevatedButton(
          child: const Text('WITH FUTURE EXCEPTION'),
          onPressed: () {
            processButtonWithFuture(futureWithException);
          },
        ),
        if (showFutureBuilder)
          FutureBuilder(
            future: process,
            builder: (context, snapshot) {
              if (snapshot.connectionState == ConnectionState.waiting)
                return const Text('WAITING');
              if (snapshot.hasError) return const Text('ERROR HAPPENED');
              if (snapshot.hasData) return const Text('ALL IS FINE');
              return Container(
                color: Colors.blue,
              );
            },
          )
      ],
    );
  }

  void processButtonWithFuture(Function future) {
    setState(() {
      showFutureBuilder = true;
      process = future();
    });
  }

  Future<String> futureWithException() async {
    throw const FormatException();
  }
}

void main() {
  testWidgets('with Future finds exception', (WidgetTester tester) async {
    await tester.pumpWidget(MaterialApp(home: MyWidget()));

    var handler = FlutterError.onError;

    FlutterError.onError = (FlutterErrorDetails errorDetails) {
      if (errorDetails.exception is FormatException)
      //  print('YES');
      FlutterError.onError = handler;
    };

    await tester.tap(find.text('WITH FUTURE EXCEPTION'));

    await tester.pump();
    await tester.pump();

  });
}

stable, master flutter doctor -v
[✓] Flutter (Channel stable, 3.3.8, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.3.8 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 52b3dc25f6 (25 hours ago), 2022-11-09 12:09:26  0800
    • Engine revision 857bd6b74c
    • Dart version 2.18.4
    • DevTools version 2.15.0

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.6.0-1.0.pre.31, on macOS 12.2.1 21D62 darwin-x64,
    locale en-GB)
    • Flutter version 3.6.0-1.0.pre.31 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 88e49ed274 (24 minutes ago), 2022-11-10 20:17:12 -0800
    • Engine revision 0721c860e2
    • Dart version 2.19.0 (build 2.19.0-383.0.dev)
    • DevTools version 2.19.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.
    
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.



@darshankawar darshankawar added found in release: 3.3 Found to occur in 3.3 found in release: 3.6 Found to occur in 3.6 c: crash Stack traces logged to the console customer: crowd Affects or could affect many people, though not necessarily a specific customer. and removed found in release: 1.21 Found to occur in 1.21 labels Nov 11, 2022
@praxder
Copy link

praxder commented Nov 28, 2022

I'm still seeing this too.

@tarekmabdallah91
Copy link

I'm facing this issue too, any help please ?

@ulisseshen
Copy link

I found this issue when running integration test on Flutter 3.0.0, and I fixed it like this:

// integration_test/smoke_test.dart

void main() async {
  testWidgets('integration test', (WidgetTester tester) async {
    final FlutterExceptionHandler? originalOnError = FlutterError.onError;
    await runMyApp();
    await tester.pumpAndSettle();
    // reset onError after calling pumpAndSettle()
    FlutterError.onError = originalOnError;

    // ...
  });
}

This worked for me on Flutter 3.3.10 stable channer.. Tks

@goderbauer
Copy link
Member

The code snippet in #34499 (comment) shows how to do this correctly.

@darshankawar darshankawar added the r: solved Issue is closed as solved label Feb 2, 2023
@IlyaMax
Copy link

IlyaMax commented Feb 7, 2023

@goderbauer but this is still a workaround because we need to add this in every test which needs expect

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: tests "flutter test", flutter_test, or one of our tests c: crash Stack traces logged to the console customer: crowd Affects or could affect many people, though not necessarily a specific customer. found in release: 3.3 Found to occur in 3.3 found in release: 3.6 Found to occur in 3.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests