Flutter: Issue when opening 10.000 files: StackOverflow - dart

I just generated 10000 files in the Flutter app project in VSC:
{placeholder0, placeholder1 ..., placeholder10000}
Each file contains simple widget returning next Placeholder, like Placeholder0 widget returns Placeholder1 widget and so on.. where Placeholder10000 returns just Text('test').
(What I also noticed VSC behaviour is getting strange once so much files is placed inside the project, like Dart Analyzer is super lagging. I could not fint any info about number of files limitations within the project). Actually is it possible to run the project with such of big number of files inside it?
Once I put Placeholder0 widget in the body of my HomePage try to run the app on simulator (iOS Simulator) i got following StackOverFlow error:
The relevant error-causing widget was
Placeholder453
lib/placeholders/placeholder452.dart:9
When the exception was thrown, this was the stack
#0 _HashBase._isDeleted (dart:collection-patch/compact_hash.dart:198:3)
#1 _LinkedHashMapMixin._init (dart:collection-patch/compact_hash.dart:429:24)
#2 _LinkedHashMapMixin._rehash (dart:collection-patch/compact_hash.dart:399:7)
#3 _LinkedHashMapMixin._insert (dart:collection-patch/compact_hash.dart:456:7)
#4 _LinkedHashMapMixin._set (dart:collection-patch/compact_hash.dart:511:7)
#5 _LinkedHashMapMixin.[]= (dart:collection-patch/compact_hash.dart:499:5)
#6 MapMixin.addAll.<anonymous closure> (dart:collection/maps.dart:129:11)
#7 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)
#8 MapMixin.addAll (dart:collection/maps.dart:128:11)
#9 _InternalLinkedHashMap.addAll (dart:collection-patch/compact_hash.dart:301:11)
#10 DiagnosticsNode.toJsonMap.<anonymous closure>
package:flutter/…/foundation/diagnostics.dart:1646
#11 DiagnosticsNode.toJsonMap
package:flutter/…/foundation/diagnostics.dart:1661
#12 DiagnosticsProperty.toJsonMap
package:flutter/…/foundation/diagnostics.dart:2666
#13 DiagnosticsNode.toJsonList.<anonymous closure>
package:flutter/…/foundation/diagnostics.dart:1686
#14 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#15 ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#16 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#17 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#18 new List.of (dart:core-patch/array_patch.dart:51:28)
#19 ListIterable.toList (dart:_internal/iterable.dart:213:44)
#20 DiagnosticsNode.toJsonList
package:flutter/…/foundation/diagnostics.dart:1687
#21 DiagnosticsNode.toJsonMap.<anonymous closure>
package:flutter/…/foundation/diagnostics.dart:1648
#22 DiagnosticsNode.toJsonMap
package:flutter/…/foundation/diagnostics.dart:1661
#23 DiagnosticsNode.toJsonList.<anonymous closure>
package:flutter/…/foundation/diagnostics.dart:1686
#24 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#25 ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
#26 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#27 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#28 new List.of (dart:core-patch/array_patch.dart:51:28)
#29 ListIterable.toList (dart:_internal/iterable.dart:213:44)
#30 DiagnosticsNode.toJsonList
package:flutter/…/foundation/diagnostics.dart:1687
#31 DiagnosticsNode.toJsonMap.<anonymous closure>
package:flutter/…/foundation/diagnostics.dart:1648
#32 DiagnosticsNode.toJsonMap
package:flutter/…/foundation/diagnostics.dart:1661
#33 WidgetInspectorService._nodeToJson
package:flutter/…/widgets/widget_inspector.dart:1606
#34 WidgetInspectorService._reportStructuredError
package:flutter/…/widgets/widget_inspector.dart:937
#35 FlutterError.reportError
package:flutter/…/foundation/assertions.dart:1184
#36 _debugReportException
package:flutter/…/widgets/framework.dart:6493
#37 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4908
#38 Element.rebuild
package:flutter/…/widgets/framework.dart:4604
#39 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4859
#40 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4853
#41 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3863
#42 Element.updateChild
package:flutter/…/widgets/framework.dart:3592
2
...
#4116 Element.rebuild
package:flutter/…/widgets/framework.dart:4604
#4117 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4859
#4118 StatefulElement._firstBuild
package:flutter/…/widgets/framework.dart:5041
#4119 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4853
... Normal element mounting (27 frames)

Related

Sending self sms from iPhone via flutter

I'm using the flutter_otp plugin for SMS.
It works fine on Android but I get this error on iPhone.
I tried different format for phone number but still the same error.
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
#2 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:542:29)
#3 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:528:64)
#8 new SmsSender._private (package:sms/sms.dart:313:44)
#9 new SmsSender (package:sms/sms.dart:307:23)
#10 FlutterOtp.sendOtp (package:flutter_otp/flutter_otp.dart:37:28)
#11 SignUpViewModel.sendOTP (package:checkin/backend/viewModels/signup_view_model.dart:122:17)
#12 SignUpView.build.<anonymous closure>.<anonymous closure> (package:checkin/backend/views/signup_view.dart:93:39)
#13 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
#14 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11)
#15 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5)
#16 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:256:7)
#17 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:158:27)
#18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:224:20)
#19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
#20 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7)
#21 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7)
#22 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7)
#26 _invoke1 (dart:ui/hooks.dart:267:10)
#27 _dispatchPointerDataPacket (dart:ui/hooks.dart:176:5)
(elided 7 frames from dart:async)
═════════════════════════════════════════════════════════════════════════════

Flutter Error : Getter not found : 'iMobileDevice' when trying to rebuild Flutter tool

Good afternoon,
I am following the tutorial on Windows 7 for an Ipad on IOS 9.3.5 :
https://medium.com/flutter-community/developing-and-debugging-flutter-apps-for-ios-without-a-mac-8d362a8ec667
and I'm stuck at rebuilding the Flutter Tool. (Last part of the tutorial)
I downloaded (from the link of the tutorial) and copied in C:\src\flutter\bin the libimobiledevice, ideviceinstaller and which binaries.
Then I ran the git apply ios.diff which gives me multiple errors, sometimes it's just about mac.dart, and sometimes it's more like this :
error: patch failed: packages/flutter_tools/lib/src/ios/devices.dart:103
error: packages/flutter_tools/lib/src/ios/devices.dart: patch does not apply
error: patch failed: packages/flutter_tools/lib/src/ios/ios_workflow.dart:26
error: packages/flutter_tools/lib/src/ios/ios_workflow.dart: patch does not apply
error: patch failed: packages/flutter_tools/lib/src/ios/mac.dart:124
error: packages/flutter_tools/lib/src/ios/mac.dart: patch does not apply
Then I found this command in here : git: patch does not apply
git apply --reject --whitespace=fix mychanges.patch
What I got was : (don't mind the content of the Future<String>, it's because I've already changed it to what it was supposed to be)
Checking patch packages/flutter_tools/lib/src/ios/mac.dart...
error: while searching for:
Future<String> getAvailableDeviceIDs() async {
try {
final ProcessResult result = await processManager.run(<String>['idevice_id', '-l']);
if (result.exitCode != 0)
throw ToolExit('idevice_id returned an error:\n${result.stderr}');
return result.stdout;
} on ProcessException {
throw ToolExit('Failed to invoke idevice_id. Run flutter doctor.');
error: patch failed: packages/flutter_tools/lib/src/ios/mac.dart:124
Applying patch packages/flutter_tools/lib/src/ios/devices.dart with 1 reject...
Rejected hunk #1.
Applying patch packages/flutter_tools/lib/src/ios/ios_workflow.dart with 1 reject...
Rejected hunk #1.
Applying patch packages/flutter_tools/lib/src/ios/mac.dart with 1 reject...
Rejected hunk #1.
At this point I manually pasted the right content in the mac.dart file (as you might have seen in the error above), but I am still not sure everything went well because of the :
error: patch failed: packages/flutter_tools/lib/src/ios/mac.dart:124
Anyway, I kept going and ran the command to rebuild the flutter tool:
bin\cache\dart-sdk\bin\dart --snapshot=.\bin\cache\flutter_tools.snapshot --packages=.\packages\flutter_tools\.packages .\packages\flutter_tools\bin\flutter_tools.dart
Finally, the output is this :
C:\src\flutter>bin\cache\dart-sdk\bin\dart --snapshot=.\bin\cache\flutter_tools.snapshot --packages=.\packages\flutter_tools\.packages .\
packages\flutter_tools\bin\flutter_tools.dart
packages/flutter_tools/lib/src/ios/ios_workflow.dart:20:30: Error: Getter not found: 'iMobileDevice'.
bool get canListDevices => iMobileDevice.isInstalled || (xcode.isInstalledAndMeetsVersionCheck && xcode.isSimctlInstalled);
^^^^^^^^^^^^^
packages/flutter_tools/lib/src/ios/ios_workflow.dart:20:30: Error: The getter 'iMobileDevice' isn't defined for the class 'IOSWorkflow'.
- 'IOSWorkflow' is from 'package:flutter_tools/src/ios/ios_workflow.dart' ('packages/flutter_tools/lib/src/ios/ios_workflow.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'iMobileDevice'.
bool get canListDevices => iMobileDevice.isInstalled || (xcode.isInstalledAndMeetsVersionCheck && xcode.isSimctlInstalled);
^^^^^^^^^^^^^
Is this "iMobileDevice" related to this libimobiledevice ? I can run any of the ideviceinstaller.exe or idevice_id.exe, so I guess I installed it correctly.
I am missing something important to correct this error ?
Thanks a lot for your time :)
in the "ios_workflow.dart" file you have to write this where the other 'import...' rows are:
import 'mac.dart';
For me, it's solved the problem.
Thanks a lot ! Importing 'mac.dart' allowed me to apply everything correctly.
I then ran flutter attach, and here is what I get : (I guess only the first lines are useful)
D:\Beerproject>flutter attach
Sending crash report to Google.
Crash report sent (report ID: 5d71ca5958062efd)
Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Crash report sent (report ID: 5024a42feb468e2b)
Oops; flutter has exited unexpectedly.
Unhandled exception:
Unsupported operation: Control of iOS devices or simulators only supported on Mac OS.
#0 IOSDevice.getAttachedDevices (package:flutter_tools/src/ios/devices.dart:172:7)
<asynchronous suspension>
#1 IOSDevices.pollingGetDevices (package:flutter_tools/src/ios/devices.dart:117:57)
#2 PollingDeviceDiscovery.devices (package:flutter_tools/src/device.dart:270:52)
<asynchronous suspension>
#3 DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:136:46)
<asynchronous suspension>
#4 DeviceValidator.validate (package:flutter_tools/src/doctor.dart:760:54)
<asynchronous suspension>
#5 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:140:52)
#6 Doctor.diagnose (package:flutter_tools/src/doctor.dart:211:41)
#7 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#8 Doctor.diagnose (package:flutter_tools/src/doctor.dart:201:24)
#9 _doctorText.<anonymous closure> (package:flutter_tools/runner.dart:202:26)
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:29)
#11 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:7)
#13 _rootRun (dart:async/zone.dart:1124:13)
#14 _CustomZone.run (dart:async/zone.dart:1021:19)
#15 _runZoned (dart:async/zone.dart:1516:10)
#16 runZoned (dart:async/zone.dart:1463:12)
#17 AppContext.run (package:flutter_tools/src/base/context.dart:153:18)
#18 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#19 AppContext.run (package:flutter_tools/src/base/context.dart:140:19)
#20 _doctorText (package:flutter_tools/runner.dart:201:19)
#21 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#22 _doctorText (package:flutter_tools/runner.dart:197:27)
#23 _createLocalCrashReport (package:flutter_tools/runner.dart:179:32)
#24 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:43:6)
#25 _createLocalCrashReport (package:flutter_tools/runner.dart:164:37)
#26 _handleToolError (package:flutter_tools/runner.dart:134:33)
#27 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#28 _rootRunUnary (dart:async/zone.dart:1132:38)
#29 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#30 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#31 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#32 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#33 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#34 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#35 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#36 CrashReportSender.sendReport (package:flutter_tools/src/reporting/crash_reporting.dart)
#37 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#38 _rootRunUnary (dart:async/zone.dart:1132:38)
#39 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#40 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#41 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#42 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#43 Future._complete (dart:async/future_impl.dart:512:7)
#44 Stream.fold.<anonymous closure> (dart:async/stream.dart:801:18)
#45 _rootRun (dart:async/zone.dart:1120:38)
#46 _CustomZone.run (dart:async/zone.dart:1021:19)
#47 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#48 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
#49 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
#50 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
#51 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:96:11)
#52 _EventSinkWrapper.close (dart:async/stream_transformers.dart:23:11)
#53 _StringAdapterSink.close (dart:convert/string_conversion.dart:249:11)
#54 _Utf8ConversionSink.close (dart:convert/string_conversion.dart:300:20)
#55 _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:80:18)
#56 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:141:24)
#57 _rootRun (dart:async/zone.dart:1120:38)
#58 _CustomZone.run (dart:async/zone.dart:1021:19)
#59 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#60 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
#61 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
#62 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
#63 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:106:10)
#64 _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:172:13)
#65 _rootRun (dart:async/zone.dart:1120:38)
#66 _CustomZone.run (dart:async/zone.dart:1021:19)
#67 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#68 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
#69 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
#70 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
#71 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:96:11)
#72 _EventSinkWrapper.close (dart:async/stream_transformers.dart:23:11)
#73 _Uint8ListConversionSink.close (dart:_http/http_impl.dart:577:13)
#74 _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:80:18)
#75 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:141:24)
#76 _rootRun (dart:async/zone.dart:1120:38)
#77 _CustomZone.run (dart:async/zone.dart:1021:19)
#78 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#79 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
#80 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
#81 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
#82 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:96:11)
#83 _EventSinkWrapper.close (dart:async/stream_transformers.dart:23:11)
#84 _ByteAdapterSink.close (dart:convert/byte_conversion.dart:62:11)
#85 _FilterSink.close (dart:io/data_transformer.dart:637:11)
#86 _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:80:18)
#87 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:141:24)
#88 _rootRun (dart:async/zone.dart:1120:38)
#89 _CustomZone.run (dart:async/zone.dart:1021:19)
#90 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#91 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
#92 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
#93 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
#94 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:106:10)
#95 _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:172:13)
#96 _rootRun (dart:async/zone.dart:1120:38)
#97 _CustomZone.run (dart:async/zone.dart:1021:19)
#98 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#99 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:389:13)
#100 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399:15)
#101 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:283:7)
#102 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:772:19)
#103 _StreamController._closeUnchecked (dart:async/stream_controller.dart:629:7)
#104 _StreamController.close (dart:async/stream_controller.dart:622:5)
#105 _HttpParser._closeIncoming (dart:_http/http_parser.dart:1037:23)
#106 _HttpParser._doParse (dart:_http/http_parser.dart:752:11)
#107 _HttpParser._parse (dart:_http/http_parser.dart:318:7)
#108 _HttpParser._onData (dart:_http/http_parser.dart:810:5)
#109 _rootRunUnary (dart:async/zone.dart:1132:38)
#110 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#111 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#112 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#113 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#114 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#115 _StreamController._add (dart:async/stream_controller.dart:640:7)
#116 _StreamController.add (dart:async/stream_controller.dart:586:5)
#117 _Socket._onData (dart:io-patch/socket_patch.dart:1791:41)
#118 _rootRunUnary (dart:async/zone.dart:1132:38)
#119 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#120 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#121 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#122 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#123 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#124 _StreamController._add (dart:async/stream_controller.dart:640:7)
#125 _StreamController.add (dart:async/stream_controller.dart:586:5)
#126 _RawSecureSocket._sendReadEvent (dart:io/secure_socket.dart:1004:19)
#127 _rootRun (dart:async/zone.dart:1120:38)
#128 _CustomZone.run (dart:async/zone.dart:1021:19)
#129 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#130 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#131 _rootRun (dart:async/zone.dart:1124:13)
#132 _CustomZone.run (dart:async/zone.dart:1021:19)
#133 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#134 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
#135 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
#136 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#137 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
Did anyone ever got this error ?
EDIT : following this tutorial step by step didn't solve the problem ... (https://www.youtube.com/watch?v=jkWPQHLOAEw)
SOLVED : I finally ended up using the Mac of a friend. Maybe could work using a virtual machine as well.

webdev error when ran without pub on windows

I do AngularDart development on Windows 10. I'm getting strange behavior with webdev recently. I have to run webdev like this:
C:\Users\galankus>C:\tools\dart-sdk\bin\pub.bat global run webdev
A tool to develop Dart web projects.
Usage: webdev <command> [arguments]
Global options:
-h, --help Print this usage information.
Available commands:
build Run builders to build a package.
help Display help information for webdev.
serve Run a local web development server and a file system watcher that re-builds on changes.
Run "webdev help <command>" for more information about a command.
If I try to run it directly, the below is what I get. Any ideas on how I can debug/fix this?
C:\Users\galankus>webdev
Crash when formatting: [Encoding] Unable to decode bytes as UTF-8.
RangeError (index): Invalid value: Not in range 0..271500, inclusive: 271792
#0 _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1 Source.getTextLine (package:kernel/ast.dart:5772:42)
#2 getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3 format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
#5 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
#6 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7 Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8 Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9 LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10 SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11 SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12 Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
<asynchronous suspension>
#14 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:232:24)
<asynchronous suspension>
#15 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#16 new Future.sync (dart:async/future.dart:222:31)
#17 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#18 _rootRun (dart:async/zone.dart:1126:13)
#19 _CustomZone.run (dart:async/zone.dart:1023:19)
#20 _runZoned (dart:async/zone.dart:1518:10)
#21 runZoned (dart:async/zone.dart:1465:12)
#22 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#23 IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
<asynchronous suspension>
#24 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
<asynchronous suspension>
#25 IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
<asynchronous suspension>
#26 Compiler.compile.<anonymous closure> (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
#27 new Future.<anonymous closure> (dart:async/future.dart:174:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#36 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#37 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
Crash when compiling file:///C:/Users/galankus/AppData/Roaming/Pub/Cache/global_packages/webdev/bin/webdev.dart.snapshot,
at character offset 264110:
RangeError (index): Invalid value: Not in range 0..271500, inclusive: 271792
#0 _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1 Source.getTextLine (package:kernel/ast.dart:5772:42)
#2 getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3 format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
#5 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
#6 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7 Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8 Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9 LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10 SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11 SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12 Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
<asynchronous suspension>
#14 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:232:24)
<asynchronous suspension>
#15 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#16 new Future.sync (dart:async/future.dart:222:31)
#17 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#18 _rootRun (dart:async/zone.dart:1126:13)
#19 _CustomZone.run (dart:async/zone.dart:1023:19)
#20 _runZoned (dart:async/zone.dart:1518:10)
#21 runZoned (dart:async/zone.dart:1465:12)
#22 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#23 IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
<asynchronous suspension>
#24 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
<asynchronous suspension>
#25 IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
<asynchronous suspension>
#26 Compiler.compile.<anonymous closure> (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
#27 new Future.<anonymous closure> (dart:async/future.dart:174:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#36 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#37 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
#0 _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1 Source.getTextLine (package:kernel/ast.dart:5772:42)
#2 getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3 format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4 ProcessedOptions.format (package:front_end/src/base/processed_options.dart:206:32)
#5 ProcessedOptions.report (package:front_end/src/base/processed_options.dart:215:22)
#6 CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7 Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8 Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9 LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10 SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11 SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12 Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13 KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:237:20)
<asynchronous suspension>
#14 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:232:24)
<asynchronous suspension>
#15 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:46)
#16 new Future.sync (dart:async/future.dart:222:31)
#17 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:118:19)
#18 _rootRun (dart:async/zone.dart:1126:13)
#19 _CustomZone.run (dart:async/zone.dart:1023:19)
#20 _runZoned (dart:async/zone.dart:1518:10)
#21 runZoned (dart:async/zone.dart:1465:12)
#22 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:117:12)
#23 IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:102:20)
<asynchronous suspension>
#24 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:38:44)
<asynchronous suspension>
#25 IncrementalCompilerWrapper.compileInternal (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:158:28)
<asynchronous suspension>
#26 Compiler.compile.<anonymous closure> (file:///E:/b/build/slave/dart-sdk-windows-dev/build/sdk/pkg/vm/bin/kernel_service.dart:132:39)
#27 new Future.<anonymous closure> (dart:async/future.dart:174:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#36 _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#37 _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
Edit: the below did not change anything, I still get the error above.
C:\Users\galankus>pub global activate webdev
Package webdev is currently active at version 0.2.3.
Resolving dependencies...
+ args 1.4.3
+ charcode 1.1.1
+ collection 1.14.10
+ io 0.3.2+1
+ meta 1.1.5
+ path 1.6.1
+ pub_semver 1.4.1
+ source_span 1.4.0
+ stack_trace 1.9.2
+ string_scanner 1.0.2
+ webdev 0.2.3
+ yaml 2.1.14
Precompiling executables...
Precompiled webdev:bin\webdev.
Installed executable webdev.
Activated webdev 0.2.3.
This was a bug in recent Dart versions that was fixed already.
Updating Dart and the global activated webdev package should fix it
To update a globally activated package, just activate it again:
pub global activate webdev
Use this Command to activate WebDev
dart pub global activate webdev

Eval Error in AngularDart

I am getting the eval error shown below, but everything in my program is in working order so am wondering why I am getting this? There is no indication of where the problem is located from the stack trace. isChecked(field, value) is a function which returns a boolean which I'm evaluating in the ng-model attribute of about 70 checkboxes generated with ng-repeat. Any help and advice on if this is an issue, would be much appreciated :)
Eval Error: Cannot assign to isChecked(field, val) while evaling [isChecked(field, val)]
FROM:
#0 Expression.assign (package:angular/core/parser/syntax.dart:45:7)
#1 _UnwrapExceptionDecorator.assign (package:angular/core/parser/parser.dart:125:26)
#2 BoundExpression.assign (package:angular/core/parser/syntax.dart:60:41)
#3 NgModel.modelValue= (package:angular/directive/ng_model.dart:211:11)
#4 NgModel.viewValue= (package:angular/directive/ng_model.dart:200:5)
#5 InputCheckbox.InputCheckbox.<anonymous closure>.<anonymous closure> (package:angular/directive/ng_model.dart:318:19)
#6 NgModelOptions._runFuncDebounced (package:angular/directive/ng_model_options.dart:80:11)
#7 NgModelOptions.executeChangeFunc (package:angular/directive/ng_model_options.dart:68:20)
#8 InputCheckbox.InputCheckbox.<anonymous closure> (package:angular/directive/ng_model.dart:317:49)
#9 _rootRunUnary (dart:async/zone.dart:915)
#10 _ZoneDelegate.runUnary (dart:async/zone.dart:510)
#11 VmTurnZone._onRunUnary.<anonymous closure> (package:angular/core/zone.dart:122:55)
#12 VmTurnZone._onRunBase (package:angular/core/zone.dart:104:16)
#13 VmTurnZone._onRunUnary (package:angular/core/zone.dart:122:7)
#14 _CustomZone.runUnary (dart:async/zone.dart:811)
#15 _CustomZone.runUnaryGuarded (dart:async/zone.dart:717)
#16 _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:743)
STACKTRACE:
#0 _UnwrapExceptionDecorator.assign (package:angular/core/parser/parser.dart:127:7)
#1 BoundExpression.assign (package:angular/core/parser/syntax.dart:60:41)
#2 NgModel.modelValue= (package:angular/directive/ng_model.dart:211:11)
#3 NgModel.viewValue= (package:angular/directive/ng_model.dart:200:5)
#4 InputCheckbox.InputCheckbox.<anonymous closure>.<anonymous closure> (package:angular/directive/ng_model.dart:318:19)
#5 NgModelOptions._runFuncDebounced (package:angular/directive/ng_model_options.dart:80:11)
#6 NgModelOptions.executeChangeFunc (package:angular/directive/ng_model_options.dart:68:20)
#7 InputCheckbox.InputCheckbox.<anonymous closure> (package:angular/directive/ng_model.dart:317:49)
#8 _rootRunUnary (dart:async/zone.dart:915)
#9 _ZoneDelegate.runUnary (dart:async/zone.dart:510)
#10 VmTurnZone._onRunUnary.<anonymous closure> (package:angular/core/zone.dart:122:55)
#11 VmTurnZone._onRunBase (package:angular/core/zone.dart:104:16)
#12 VmTurnZone._onRunUnary (package:angular/core/zone.dart:122:7)
#13 _CustomZone.runUnary (dart:async/zone.dart:811)
#14 _CustomZone.runUnaryGuarded (dart:async/zone.dart:717)
#15 _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:743)
HTML of checkboxes:
<fieldset ng-repeat="field in $.filterFields">
<legend>Filter by {{field}}</legend>
<span ng-repeat="val in $.getValuesForField(field)">
<label>{{val}}</label>
<input type="checkbox" ng-click="$.checkboxClicked(field, val)" ng-model="isChecked(field, val)">
</span>
</fieldset>
Source code of isChecked:
bool isChecked(String key, String value){
if(alertFilter.containsKey(key) && alertFilter[key].contains(value)) {
return true;
}
else{
return false;
}
}
P.S. 'alertFilter' here is obtained from a service. The error fires when alertFilter is updated - which triggers 4 other parts of the program which share this filter, to update. Note that these other parts do not update alertFilter, they only read from it.

reflectable 0.3.4 - new version throwing exception

I just updated my dart application and did a pub cache repair afterwards.
The application does not run and debug throws the following exception
Uncaught Unhandled exception:
Unsupported operation: Cannot provide `reflectedType` of instance of generic type 'List'.
#0 InstantiatedGenericClassMirrorImpl.reflectedType (package:reflectable/src/reflectable_transformer_based.dart:713:5)
#1 _getPropertyInfoForType (package:polymer/src/common/polymer_descriptor.dart:210:46)
#2 _buildPropertiesObject.<anonymous closure> (package:polymer/src/common/polymer_descriptor.dart:58:24)
#3 _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:340)
#4 _buildPropertiesObject (package:polymer/src/common/polymer_descriptor.dart:56:16)
#5 createPolymerDescriptor (package:polymer/src/common/polymer_descriptor.dart:26:19)
#6 PolymerRegister.initialize (package:polymer/src/common/polymer_register.dart:19:36)
#7 loadInitializers.<anonymous closure>.<anonymous closure> (package:initialize/src/static_loader.dart:46:32)
#8 _runInitQueue (package:initialize/initialize.dart:35:24)
#9 _runInitQueue.<anonymous closure> (package:initialize/initialize.dart:38:26)
#10 _RootZone.runUnary (dart:async/zone.dart:1149)
#11 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:502)
#12 _Future._propagateToListeners (dart:async/future_impl.dart:585)
#13 _Future._completeWithValue (dart:async/future_impl.dart:376)
#14 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:430)
#15 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#16 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#17 _ScheduleImmediateHelper._handleMutation (dart:html:49254)
#18 MutationObserver._create.<anonymous closure> (dart:html:27526)
(anonymous function)
The application was running quite well before.
Possible bug?
Thanks
Teddy
Rather long story, please check https://github.com/dart-lang/polymer-dart/issues/651 for some details, and for the resolution of this issue as it unfolds.

Resources