Skip to content

Dart static type context signature crash in 1.17 #56479

Closed

Description

@flareso

Hi guys, since updating to 1.17 I'm getting this error:
Doctor all good.
Tried clean, delete derived data, reinstall flutter

 Unhandled exception:
    NoSuchMethodError: The getter 'enclosingLibrary' was called on null.
    Receiver: null
    Tried calling: enclosingLibrary
    #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
    #1      new StaticTypeContext (package:kernel/type_environment.dart:763:27)
    #2      _TreeShakerPass1.staticTypeContext (package:vm/transformations/type_flow/transformer.dart:752:30)
    #3      _TreeShakerPass1._fixArgumentEvaluationOrder (package:vm/transformations/type_flow/transformer.dart:1007:41)
    #4      _TreeShakerPass1.visitConstructorInvocation (package:vm/transformations/type_flow/transformer.dart:1170:22)
    #5      ConstructorInvocation.accept (package:kernel/ast.dart:3964:44)
    #6      Field.transformChildren (package:kernel/ast.dart:1862:33)
    #7      _TreeShakerPass1.visitField (package:vm/transformations/type_flow/transformer.dart:903:16)
    #8      Field.accept (package:kernel/ast.dart:1847:40)
    #9      transformList (package:kernel/ast.dart:8700:27)
    #10     _TreeShakerPass1.visitClass (package:vm/transformations/type_flow/transformer.dart:856:5)
    #11     Class.accept (package:kernel/ast.dart:1375:38)
    #12     transformList (package:kernel/ast.dart:8700:27)
    #13     Library.transformChildren (package:kernel/ast.dart:627:5)
    #14     Transformer.defaultTreeNode (package:kernel/visitor.dart:650:10)
    #15     TreeVisitor.visitLibrary (package:kernel/visitor.dart:254:35)
    #16     Library.accept (package:kernel/ast.dart:609:38)
    #17     transformList (package:kernel/ast.dart:8700:27)
    #18     Component.transformChildren (package:kernel/ast.dart:8516:5)
    #19     _TreeShakerPass1.transform (package:vm/transformations/type_flow/transformer.dart:764:15)
    #20     TreeShaker.transformComponent (package:vm/transformations/type_flow/transformer.dart:582:12)
    #21     transformComponent (package:vm/transformations/type_flow/transformer.dart:76:7)
    #22     runGlobalTransformations (package:vm/kernel_front_end.dart:425:5)
    #23     compileToKernel (package:vm/kernel_front_end.dart:336:11)
    <asynchronous suspension>
    #24     FrontendCompiler.compile.<anonymous closure> (package:frontend_server/frontend_server.dart:510:54)
    #25     new Future.<anonymous closure> (dart:async/future.dart:176:37)
    #26     _rootRun (dart:async/zone.dart:1180:38)
    #27     _CustomZone.run (dart:async/zone.dart:1077:19)
    #28     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
    #29     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
    #30     _rootRun (dart:async/zone.dart:1184:13)
    #31     _CustomZone.run (dart:async/zone.dart:1077:19)
    #32     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1003:23)
    #33     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
    #34     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
    #35     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
    #36     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

    Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
    build failed.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Activity

  1. self-assigned this
    on May 6, 2020
  2. mraleph commented on May 6, 2020

    @mraleph
    Member

    Looks like it is caused by the dart-lang/sdk@a67aac8 - visitField should be setting currentMember but it does not.

    /cc @mkustermann @alexmarkov

    The bug is affecting one of the fields in one of your classes which has initialiser invoking a constructor which has optional parameters - unfortunately it is unclear to me if there is an easy way to locate which field in one of you classes is affected. There is no information about this in stack trace, and unfortunately I don't think we have any debug logging that would allow us to pinpoint it.

    /cc @pcsosinski

  3. alexmarkov commented on May 6, 2020

    @alexmarkov
    Contributor

    This crash started to happen since tree-shaker started converting optional parameters to required (since dart-lang/sdk@a67aac8 or more earlier commit dart-lang/sdk@9ab51b8 which was reverted). Crash could happen when tree shaker converts optional parameters to required parameters in a call inside field initializer.

    https://dart-review.googlesource.com/c/sdk/+/146980 should fix this bug.

  4. flareso commented on May 6, 2020

    @flareso
    Author

    Guys, it's on the stable channel.. what can we do? ive tried to downgrade but the command not working.

  5. ayush221b commented on May 7, 2020

    @ayush221b
  6. pcsosinski commented on May 7, 2020

    @pcsosinski

    what command are you trying to run to downgrade?

  7. flareso commented on May 7, 2020

    @flareso
    Author

    flutter downgrade @pcsosinski

  8. flareso commented on May 7, 2020

    @flareso
    Author

    I did 'flutter version v1.12.13+hotfix.9' to downgrade it back.

  9. mkustermann commented on May 7, 2020

    @mkustermann
    Member

    /cc @franklinyow This would be a cherry-pick candidate dart-lang/sdk@32d4ac9

  10. tvolkert commented on May 7, 2020

    @tvolkert
    Contributor

    @dvird we're looking to issue a stable update (1.17.1) to fix this.

  11. flareso commented on May 7, 2020

    @flareso
    Author

    Great, thanks :) how long you estimate it's going to take for you? @tvolkert

  12. 3 remaining items

  13. xster commented on May 8, 2020

    @xster
    Member

    https://dart-review.googlesource.com/c/sdk/+/146980 doesn't look like there's anything iOS specific is there?

  14. alexmarkov commented on May 8, 2020

    @alexmarkov
    Contributor

    @xster The bug and the fix are not iOS specific.

  15. changed the title [-]iOS build error 1.17[/-] [+]Dart static type context signature crash in 1.17[/+] on May 8, 2020
  16. pcsosinski commented on May 11, 2020

    @pcsosinski

    CP'd into dart

  17. tvolkert commented on May 20, 2020

    @tvolkert
    Contributor

    Should this be closed now?

  18. alexmarkov commented on May 20, 2020

    @alexmarkov
    Contributor

    Yes, the fix was rolled into Flutter.

  19. github-actions commented on Aug 21, 2021

    @github-actions

    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.

  20. locked as resolved and limited conversation to collaborators on Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions