Bloc: Try correcting the name to the name of an existing getter, or defining a getter or field named 'debugDoingBuild'. assert(widget is LayoutBuilder || debugDoingBuild, '''

Created on 5 Aug 2020  Ā·  2Comments  Ā·  Source: felangel/bloc

Compiler Failed

Bloc Version

flutter_bloc: ^6.0.0

Error Msg

Compiler message:
../../flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub/provider-4.3.1/lib/src/provider.dart:545:15: Error: The getter 'debugDoingBuild' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'debugDoingBuild'.
            (!debugDoingBuild && !debugIsInInheritedProviderUpdate),
              ^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub/provider-4.3.1/lib/src/provider.dart:582:13: Error: The getter 'debugDoingBuild' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'debugDoingBuild'.
            debugDoingBuild ||
            ^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub/provider-4.3.1/lib/src/inherited_provider.dart:215:39: Error: The getter 'debugDoingBuild' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'debugDoingBuild'.
    assert(widget is LayoutBuilder || debugDoingBuild, '''
                                      ^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
Failed to build bundle.
Error launching application on iPhone 11.

Flutter Doctor

 flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[āœ“] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-CN)

[āœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[āœ“] Xcode - develop for iOS and macOS (Xcode 11.5)
[āœ“] Android Studio (version 3.5)
[āœ“] Android Studio (version 3.6)
[!] Android Studio (version 4.0)
    āœ— Flutter plugin not installed; this adds Flutter specific functionality.
    āœ— Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2018.1.7)
    āœ— Flutter plugin not installed; this adds Flutter specific functionality.
    āœ— Dart plugin not installed; this adds Dart specific functionality.
[āœ“] Connected device (4 available)

! Doctor found issues in 2 categories.

Dart Version

 dart --version
Dart VM version: 2.7.0 (Mon Dec 2 20:10:59 2019 +0100) on "macos_x64"

How can i solve this problem ? Thx

dependency question

Most helpful comment

@felangel Thank you very much. According to your , I solved the problem. o( ̄▽ ̄)d

All 2 comments

Hi @kaina404 šŸ‘‹
Thanks for opening an issue!

Looks like the exception is thrown within provider and I’m guessing you just need to do a flutter upgrade to use the latest stable (provider needs flutter: '>= 1.16.0' for the latest version).

Let me know if that helps šŸ‘

@felangel Thank you very much. According to your , I solved the problem. o( ̄▽ ̄)d

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nerder picture nerder  Ā·  3Comments

craiglabenz picture craiglabenz  Ā·  3Comments

timtraversy picture timtraversy  Ā·  3Comments

shawnchan2014 picture shawnchan2014  Ā·  3Comments

clicksocial picture clicksocial  Ā·  3Comments