Unable to resolve asset ID for "dart:core" - dart

I am getting a Unable to resolve asset ID for "dart:core" error for every SDK I have tried between 1.8 and 1.13, and for 3 different types of text editors with different dart plugins. Is there any way to fix the following:
$ /c/tools/dart-sdk-1-9-3/bin/pub.bat serve
find: ‘> bin [’: No such file or directory
Loading source assets...
Loading angular transformers...
Serving ProjectName web on http://localhost:8080
[Error from InjectorGenerator on ProjectName|web/main.dart]:
Unable to resolve asset ID for "dart:core"
Build error:
Transform InjectorGenerator on ProjectName|web/main.dart threw error: <rethrow>
Caused by Could not resolve dart:core
AnalysisTask._safelyPerform (package:analyzer/src/generated/engine.dart:6762:7)
AnalysisTask.perform (package:analyzer/src/generated/engine.dart:6727:21)
AnalysisContextImpl._cacheDartResolutionData (package:analyzer/src/generated/engine.dart:2414:86)
AnalysisContextImpl._getDartResolutionData (package:analyzer/src/generated/engine.dart:3046:41)
AnalysisContextImpl._getDartResolutionData2 (package:analyzer/src/generated/engine.dart:3077:36)
AnalysisContextImpl.computeLibraryElement (package:analyzer/src/generated/engine.dart:1192:81)
ResolverImpl._performResolve.<anonymous closure>.<anonymous closure> (package:code_transformers/src/resolver_impl.dart:157:46)
MappedListIterable.elementAt (dart:_internal/iterable.dart:413)
ListIterable.toList (dart:_internal/iterable.dart:219)
ResolverImpl._performResolve.<anonymous closure> (package:code_transformers/src/resolver_impl.dart:158:16)
_RootZone.runUnary (dart:async/zone.dart:1155)
_Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:484)
_Future._propagateToListeners (dart:async/future_impl.dart:567)
_Future._completeWithValue (dart:async/future_impl.dart:358)
_Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:412)
_asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
_asyncRunCallback (dart:async/schedule_microtask.dart:48)
_runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
_RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:143)
package:analyzer/src/generated/engine.dart 2115:11 AnalysisContextImpl.recordResolveDartLibraryTaskResults
package:analyzer/src/generated/engine.dart 5304:133 AnalysisContextImpl_AnalysisTaskResultRecorder.visitResolveDartLibraryTask
package:analyzer/src/generated/engine.dart 14327:77 ResolveDartLibraryTask.accept
package:analyzer/src/generated/engine.dart 6732:18 AnalysisTask.perform
package:analyzer/src/generated/engine.dart 2414:86 AnalysisContextImpl._cacheDartResolutionData
package:analyzer/src/generated/engine.dart 3046:41 AnalysisContextImpl._getDartResolutionData
package:analyzer/src/generated/engine.dart 3077:36 AnalysisContextImpl._getDartResolutionData2
package:analyzer/src/generated/engine.dart 1192:81 AnalysisContextImpl.computeLibraryElement
package:code_transformers/src/resolver_impl.dart 157:46 ResolverImpl._performResolve.<fn>.<fn>
dart:_internal/iterable.dart 413 MappedListIterable.elementAt
dart:_internal/iterable.dart 219 ListIterable.toList
package:code_transformers/src/resolver_impl.dart 158:16 ResolverImpl._performResolve.<fn>
dart:async/zone.dart 1155 _RootZone.runUnary
dart:async/future_impl.dart 484 _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 567 _Future._propagateToListeners
dart:async/future_impl.dart 358 _Future._completeWithValue
dart:async/future_impl.dart 412 _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 41 _asyncRunCallbackLoop
dart:async/schedule_microtask.dart 48 _asyncRunCallback
dart:isolate-patch/isolate_patch.dart 96 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 143 _RawReceivePortImpl._handleMessage
package:analyzer/src/generated/engine.dart 2115:11 AnalysisContextImpl.recordResolveDartLibraryTaskResults
package:analyzer/src/generated/engine.dart 5304:133 AnalysisContextImpl_AnalysisTaskResultRecorder.visitResolveDartLibraryTask
package:analyzer/src/generated/engine.dart 14327:77 ResolveDartLibraryTask.accept
package:analyzer/src/generated/engine.dart 6732:18 AnalysisTask.perform
package:analyzer/src/generated/engine.dart 2414:86 AnalysisContextImpl._cacheDartResolutionData
package:analyzer/src/generated/engine.dart 3046:41 AnalysisContextImpl._getDartResolutionData
package:analyzer/src/generated/engine.dart 3077:36 AnalysisContextImpl._getDartResolutionData2
package:analyzer/src/generated/engine.dart 1192:81 AnalysisContextImpl.computeLibraryElement
package:code_transformers/src/resolver_impl.dart 157:46 ResolverImpl._performResolve.<fn>.<fn>
dart:_internal ListIterable.toList
package:code_transformers/src/resolver_impl.dart 158:16 ResolverImpl._performResolve.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
Build completed with 2 errors.
Update:
content of pubspec.yaml file is:
name: ProjectName
version: 0.1.1
description: "desc..."
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
angular: 1.1.0
browser: any
crypto: any
# polymer_highcharts: any
transformers:
- angular
The OS is Windows 10. It works on Windows 8 and Ubuntu 14.04 for Dart SDK's 1.9.1 -> 1.12.2, but not with 1.13.1 (similar issue to above)

It's a known issue with the code_transformer package. See Dart SDK issue 25009. angular.dart issue 1743

Related

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.

Flutter doctor is crashing on macos

I follow this guide. After unzip flutter I run flutter doctor and take an error
⡿Unhandled exception:
NoSuchMethodError: The method '<' was called on null.
Receiver: null
Tried calling: <(Instance of 'Version')
Full stack
~/development/flutter/bin/flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale ru-RU)
• Flutter version 1.0.0 at /Users/naumov_evg/development/flutter
• Framework revision 5391447fae (6 weeks ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
⡿Unhandled exception:
NoSuchMethodError: The method '<' was called on null.
Receiver: null
Tried calling: <(Instance of 'Version')
#0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
#1 CocoaPods.evaluateCocoaPodsInstallation (package:flutter_tools/src/ios/cocoapods.dart:69:28)
<asynchronous suspension>
#2 CocoaPodsValidator.validate (package:flutter_tools/src/ios/ios_workflow.dart:231:12)
<asynchronous suspension>
#3 GroupedValidator.validate (package:flutter_tools/src/doctor.dart:304:52)
#4 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#5 GroupedValidator.validate (package:flutter_tools/src/doctor.dart:301:36)
#6 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:111:52)
#7 Doctor.diagnose (package:flutter_tools/src/doctor.dart:184:41)
#8 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#9 Doctor.diagnose (package:flutter_tools/src/doctor.dart:174:24)
#10 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:48:39)
#11 _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#12 DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:34:42)
#13 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:401:18)
#14 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#15 _rootRunUnary (dart:async/zone.dart:1132:38)
#16 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#17 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#18 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#19 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#20 Future._complete (dart:async/future_impl.dart:476:7)
#21 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#22 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#23 _rootRun (dart:async/zone.dart:1124:13)
#24 _CustomZone.run (dart:async/zone.dart:1021:19)
#25 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#26 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#29 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

Flutter fails on `flutter` command

I'm following the Getting Started with Flutter guide and getting stuck when running the actual flutter command:
flutter init -o my_app
Resolving dependencies...
Error on line 17, column 16 of pubspec.yaml: Invalid version constraint: Could not parse version "^1.4.0". Unknown text at "^1.4.0".
stack_trace: ^1.4.0
^^^^^^
Unhandled exception:
Uncaught Error: FileSystemException: Cannot open file, path = '/Users/craig/Code/flutter/packages/flutter_tools/packages/sky_tools/executable.dart' (OS Error: No such file or directory, errno = 2)
Stack Trace:
#0 _File.open.<anonymous closure> (dart:io/file_impl.dart:349)
#1 _RootZone.runUnary (dart:async/zone.dart:1151)
#2 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:496)
#3 _Future._propagateToListeners (dart:async/future_impl.dart:579)
#4 _Future._completeWithValue (dart:async/future_impl.dart:339)
#5 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:401)
#6 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#7 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#8 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:883)
#1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
Unhandled exception:
Uncaught Error: FileSystemException: Cannot open file, path = '/Users/craig/Code/flutter/bin/cache/flutter_tools.snapshot' (OS Error: No such file or directory, errno = 2)
Stack Trace:
#0 _File.open.<anonymous closure> (dart:io/file_impl.dart:349)
#1 _RootZone.runUnary (dart:async/zone.dart:1151)
#2 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:496)
#3 _Future._propagateToListeners (dart:async/future_impl.dart:579)
#4 _Future._completeWithValue (dart:async/future_impl.dart:339)
#5 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:401)
#6 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#7 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#8 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:883)
#1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
Looks like your Dart version is outdated < 1.9.2.
Try dart --version to get the version of your installed Dart SDK.
Current is 1.12.x.
Update 2018-03-20
During the migration phase to Dart 2 you might want to install Dart from the dev channel to get a 2.0.0-alpha.x version.
The newest stable version is 1.24.x
For example
brew install dart --devel
Update 2018-06-21
Now also supported:
brew install dart#2
For others who're facing a similar error, I suggest that you read the docs carefully. I didn't, hence I wasted quite some time looking out for the solution elsewhere, even though it was right in front of my eyes all the time: https://flutter.io/setup-macos/#update-your-path
I'm writing the commands down so that you can copy and paste them easily in your terminal window:
touch $HOME/.bash_profile
open $HOME/.bash_profile
Line 1 creates a text file named .bash_profile. Line 2 opens it.
Then the line given below has to be pasted in the text file:
export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
Don't forget to save the file after pasting. flutter doctor should work with every Terminal window now.
Open your terminal and run this
export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
then run flutter, it will work.
It's because you the path you set up is temporary. To add the path
export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
[PATH_TO_FLUTTER_GIT_DIRECTORY] -> Folder where you downloaded flutter or cloned from git.
Then do
echo $PATH
Watch this video to easy install
https://www.youtube.com/watch?v=Em8igImhBKc

DART pub get failed after update from 1.60 to 1.72: Failed to precompile intl:extract_to_arb

Last night, I accidentally updated my Dart Editor and SDK version from 1.60 to 1.72. Accidentally meaning I didn't want to change my development environment while I was developing, but it happened. After that, I see this when I try to "pub get":
>--- 7:48:46 AM Running pub get on /Users/Clayvessel/Dropbox/PROJECT/DART/DART_Project/OneViewer_Composite-Viewer/OneViewer_6 ... ---
>Resolving dependencies...
>Got dependencies!
>Precompiling executables...
>Loading source assets...
>Failed to precompile intl:extract_to_arb:
>Unhandled exception:
>Uncaught Error: Failure getting http://localhost:51271/packages/intl/extract_messages.dart: 404 Not Found
>Stack Trace:
>#0 _asyncLoadError (dart:_builtin:285)
>#1 _httpGet.<anonymous closure>.<anonymous closure> (dart:_builtin:228)
>#2 _RootZone.runGuarded (dart:async/zone.dart:1078)
>#3 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
>#4 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
>#5 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:290)
>#6 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:110)
>#7 _handleDone (dart:async/stream_pipe.dart:178)
>#8 _RootZone.runGuarded (dart:async/zone.dart:1078)
>#9 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
>#10 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
>#11 _DelayedDone.perform (dart:async/stream_impl.dart:614)
>#12 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:711)
>#13 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:671)
>#14 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
>#15 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
>#16 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
>#17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
>
>#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:883)
>#1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
>#2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
>#3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
>#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
>Failed to precompile intl:generate_from_arb:
>Unhandled exception:
>Uncaught Error: Failure getting http://localhost:51271/packages/intl/extract_messages.dart: 404 Not Found
>Stack Trace:
>#0 _asyncLoadError (dart:_builtin:285)
>#1 _httpGet.<anonymous closure>.<anonymous closure> (dart:_builtin:228)
>#2 _RootZone.runGuarded (dart:async/zone.dart:1078)
>#3 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
>#4 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
>#5 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:290)
>#6 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:110)
>#7 _handleDone (dart:async/stream_pipe.dart:178)
>#8 _RootZone.runGuarded (dart:async/zone.dart:1078)
>#9 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
>#10 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
>#11 _DelayedDone.perform (dart:async/stream_impl.dart:614)
>#12 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:711)
>#13 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:671)
>#14 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
>#15 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
>#16 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
>#17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
>
>#0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:883)
>#1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
>#2 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
>#3 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
>#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
Specifically it is complaining about the two things:
import 'package:chart/chart.dart'
import 'package:chrome/chrome_app.dart' as chrome
They were working just fine before I update Dart SDK. In Dart Editor, it complains:
Target of URI does not exist
As a novice in Dart, I have done exhaustive searches and din't have a luck. Deadline is coming and I anxiously looking for a solution to this. I develop on Mac Book. But I have a Windows 7 notebook as well. They are sharing project folders equipped by Dropbox. Yesterday before this error happen, I updated my OS X to Yosemite. While the machine was updating, I tried to pub get and compile dart2js for my project in Windows 7 notebook. It generated some errors. So I deleted my whole Dart folder and downloaded it again now from Mac Book. And I realised now dart has been updated to 1.7.2.
Any help on this would be greatly appreciated!
On the command line, running "pub cache repair" might help. I frequently have to do this when I update.

Getting build error from Dart, NoSuchMethodError: incorrect number of arguments passed to method named '_greaterThanFromInteger#0x36924d72'

My dart application runs normally when I run it from the debugger, now I have decided to build to get the Javascript built, I get this strange build error and I have no idea.
I have not built for a long time as I was just running from the debugger. How can I try to find out what is causing the error? I can try to comment out code I guess until the error goes away, but that's going to be tedious.
Here is a pastebin of entire build.
Build error:
Transform InlineCodeExtractor on minuteheet|web/minuteheet.html threw error: Closure call with mismatched arguments: function '_greaterThanFromInteger#0x36924d72'
NoSuchMethodError: incorrect number of arguments passed to method named '_greaterThanFromInteger#0x36924d72'
Receiver: Closure: () => int from Function 'length':.
Tried calling: _greaterThanFromInteger#0x36924d72(0)
Found: _greaterThanFromInteger#0x36924d72()
dart:core-patch/object_patch.dart 45 Object.noSuchMethod
dart:core-patch/integers.dart 75 int.>
dart:core-patch/integers.dart 78 int.>=
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 496:25 CharSequenceReader.advance
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 904:33 Scanner.tokenize
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 912:7 Scanner.tokenize
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 912:7 Scanner.tokenize
http://127.0.0.1:50622/packages/polymer/src/build/code_extractor.dart 78:31 _hasLibraryDirective
http://127.0.0.1:50622/packages/polymer/src/build/code_extractor.dart 58:34 InlineCodeExtractor.apply.<fn>
dart:async/zone.dart 730 _rootRunUnary
dart:async/zone.dart 864 _RootZone.runUnary
dart:async/future_impl.dart 488 _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 571 _Future._propagateToListeners
dart:async/future_impl.dart 331 _Future._completeWithValue
dart:async/future_impl.dart 393 _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 1 _AsyncCallbackEntry.callback
dart:async/schedule_microtask.dart 23 _asyncRunCallbackLoop
dart:async/schedule_microtask.dart 32 _asyncRunCallback
dart:isolate-patch/isolate_patch.dart 119 _RawReceivePortImpl._handleMessage
dart:core int.>=
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 496:25 CharSequenceReader.advance
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 904:33 Scanner.tokenize
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 912:7 Scanner.tokenize
http://127.0.0.1:50622/packages/analyzer/src/generated/scanner.dart 912:7 Scanner.tokenize
http://127.0.0.1:50622/packages/polymer/src/build/code_extractor.dart 78:31 _hasLibraryDirective
http://127.0.0.1:50622/packages/polymer/src/build/code_extractor.dart 58:34 InlineCodeExtractor.apply.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
[Warning from _Serial on minuteheet|web/main.dart with input minuteheet|lib/components/menu_component.dart]:
package:minuteheet/components/menu_component.dart:7:1: Unable to find ../lib/components/menu.html at minuteheet|../lib/components/menu.html
Removing dart polymer made the error go away.

Resources