Repository navigation
Dart static type context signature crash in 1.17 #56479
Copy link
Copy link
Closed
Labels
dependency: dartDart team may need to help usDart team may need to help usfound in release: 1.17Found to occur in 1.17Found to occur in 1.17found in release: 1.18Occurs in 1.18Occurs in 1.18
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dependency: dartDart team may need to help usDart team may need to help usfound in release: 1.17Found to occur in 1.17Found to occur in 1.17found in release: 1.18Occurs in 1.18Occurs in 1.18
Activity
mraleph commentedon May 6, 2020
Looks like it is caused by the dart-lang/sdk@a67aac8 -
visitFieldshould be settingcurrentMemberbut 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
alexmarkov commentedon May 6, 2020
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.
flareso commentedon May 6, 2020
Guys, it's on the stable channel.. what can we do? ive tried to downgrade but the command not working.
[vm/aot/tfa] Fix crash while getting static type context for signatur…
ayush221b commentedon May 7, 2020
cc @Hixie
pcsosinski commentedon May 7, 2020
what command are you trying to run to downgrade?
flareso commentedon May 7, 2020
flutter downgrade @pcsosinski
flareso commentedon May 7, 2020
I did 'flutter version v1.12.13+hotfix.9' to downgrade it back.
mkustermann commentedon May 7, 2020
/cc @franklinyow This would be a cherry-pick candidate dart-lang/sdk@32d4ac9
tvolkert commentedon May 7, 2020
@dvird we're looking to issue a stable update (
1.17.1) to fix this.flareso commentedon May 7, 2020
Great, thanks :) how long you estimate it's going to take for you? @tvolkert
3 remaining items
xster commentedon May 8, 2020
https://dart-review.googlesource.com/c/sdk/+/146980 doesn't look like there's anything iOS specific is there?
alexmarkov commentedon May 8, 2020
@xster The bug and the fix are not iOS specific.
[-]iOS build error 1.17[/-][+]Dart static type context signature crash in 1.17[/+]pcsosinski commentedon May 11, 2020
CP'd into dart
[vm/aot/tfa] Fix crash while getting static type context for signatur…
tvolkert commentedon May 20, 2020
Should this be closed now?
alexmarkov commentedon May 20, 2020
Yes, the fix was rolled into Flutter.
github-actions commentedon Aug 21, 2021
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 -vand a minimal reproduction of the issue.