Issue 1:
Need help

Notification in the debug console is showing this :

Launching lib/main.dart on iPhone 8 in debug mode...

Xcode build done.

[VERBOSE-2:dart_error.cc(16)] Dart_LoadScriptFromKernel: The binary program does not contain 'main'.

[VERBOSE-2:engine.cc(147)] Could not prepare to run the isolate.

[VERBOSE-2:engine.cc(112)] Engine not prepare and launch isolate.

And the log file is showing this :

Flutter crash report; please file at https://github.com/flutter/flutter/issues.

command

flutter build bundle --suppress-analytics --target /Users/mymac/Documents/Code/Flutter/navigation_routes/lib/main.dart --preview-dart-2 --filesystem-scheme org-dartlang-root --depfile /Users/mymac/Documents/Code/Flutter/navigation_routes/build/app/intermediates/flutter/debug/snapshot_blob.bin.d --asset-dir /Users/mymac/Documents/Code/Flutter/navigation_routes/build/app/intermediates/flutter/debug/flutter_assets

exception

RangeError: RangeError (index): Invalid value: Only valid value is 0: 1

#0 List.[] (dart:core-patch/dart:core/growable_array.dart:141)
#1 readDepfile (package:flutter_tools/src/base/fingerprint.dart:174)
<asynchronous suspension>
#2 Fingerprinter._getPaths (package:flutter_tools/src/base/fingerprint.dart:88)
<asynchronous suspension>
#3 Fingerprinter.doesFingerprintMatch (package:flutter_tools/src/base/fingerprint.dart:60)
<asynchronous suspension>
#4 KernelCompiler.compile (package:flutter_tools/src/compile.dart:104)
<asynchronous suspension>
#5 build (package:flutter_tools/src/bundle.dart:74)
<asynchronous suspension>
#6 BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:67)
<asynchronous suspension>
#7 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:344)
<asynchronous suspension>
#8 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:279)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#10 _rootRun (dart:async/zone.dart:1126)
#11 _CustomZone.run (dart:async/zone.dart:1023)
#12 runZoned (dart:async/zone.dart:1501)
#13 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#14 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:270)
#15 CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#16 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:309)
<asynchronous suspension>
#17 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#18 _rootRun (dart:async/zone.dart:1126)
#19 _CustomZone.run (dart:async/zone.dart:1023)
#20 runZoned (dart:async/zone.dart:1501)
#21 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#22 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:265)
<asynchronous suspension>
#23 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#24 new Future.sync (dart:async/future.dart:222)
#25 CommandRunner.run (package:args/command_runner.dart:109)
#26 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:174)
#27 run.<anonymous closure> (package:flutter_tools/runner.dart:54)
<asynchronous suspension>
#28 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#29 _rootRun (dart:async/zone.dart:1126)
#30 _CustomZone.run (dart:async/zone.dart:1023)
#31 runZoned (dart:async/zone.dart:1501)
#32 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#33 runInContext (package:flutter_tools/src/context_runner.dart:43)
<asynchronous suspension>
#34 run (package:flutter_tools/runner.dart:49)
#35 main (package:flutter_tools/executable.dart:49)
<asynchronous suspension>
#36 main (file:///b/build/slave/Mac_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#37 _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#38 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)

flutter doctor

[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.4 17E202, locale en-US)
• Flutter version 0.4.4 at /flutter
• Framework revision f9bb4289e9 (3 weeks ago), 2018-05-11 21:44:54 -0700
• Engine revision 06afdfe54e
• Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/mymac/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4, Build version 9F1027a
• ios-deploy 1.9.2
• CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.23.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension version 2.13.0

[✓] Connected devices (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!

Issue 2:
a very simple start-up app, and runs good, but suddenly crash, then can never run again:

Source (main.dart):

import 'dart:math';

import 'package:flutter/material.dart';

void main() {
runApp(new MaterialApp(home: new ChartPage()));
}

class ChartPage extends StatefulWidget {
@override
ChartPageState createState() => new ChartPageState();
}

class ChartPageState extends State<ChartPage> {
final random = new Random();
int dataSet;

void changeData() {
setState(() {
dataSet = random.nextInt(100);
});
}

@override
Widget build(BuildContext context) {
return new Scaffold(
body: new Center(
child: new Text('Data set: $dataSet'),
),
floatingActionButton: new FloatingActionButton(
child: new Icon(Icons.refresh),
onPressed: changeData,
),
);
}
}

Logs

Flutter crash report; please file at https://github.com/flutter/flutter/issues.

command

flutter run -d D98B467B-1756-436B-9DAF-98E915394BA3

exception

RangeError: RangeError (index): Invalid value: Only valid value is 0: 1

#0 List.[] (dart:core-patch/dart:core/growable_array.dart:141)
#1 readDepfile (package:flutter_tools/src/base/fingerprint.dart:174)
<asynchronous suspension>
#2 Fingerprinter._getPaths (package:flutter_tools/src/base/fingerprint.dart:88)
<asynchronous suspension>
#3 Fingerprinter.doesFingerprintMatch (package:flutter_tools/src/base/fingerprint.dart:60)
<asynchronous suspension>
#4 KernelCompiler.compile (package:flutter_tools/src/compile.dart:104)
<asynchronous suspension>
#5 build (package:flutter_tools/src/bundle.dart:74)
<asynchronous suspension>
#6 IOSSimulator._sideloadUpdatedAssetsForInstalledApplicationBundle (package:flutter_tools/src/ios/simulators.dart:388)
#7 IOSSimulator._setupUpdatedApplicationBundle (package:flutter_tools/src/ios/simulators.dart:354)
<asynchronous suspension>
#8 IOSSimulator.startApp (package:flutter_tools/src/ios/simulators.dart:286)
<asynchronous suspension>
#9 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:289)
<asynchronous suspension>
#10 HotRunner.run (package:flutter_tools/src/run_hot.dart:216)
<asynchronous suspension>
#11 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:399)
<asynchronous suspension>
#12 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:344)
<asynchronous suspension>
#13 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:279)
<asynchronous suspension>
#14 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#15 _rootRun (dart:async/zone.dart:1126)
#16 _CustomZone.run (dart:async/zone.dart:1023)
#17 runZoned (dart:async/zone.dart:1501)
#18 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#19 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:270)
#20 CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#21 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:309)
<asynchronous suspension>
#22 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#23 _rootRun (dart:async/zone.dart:1126)
#24 _CustomZone.run (dart:async/zone.dart:1023)
#25 runZoned (dart:async/zone.dart:1501)
#26 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#27 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:265)
<asynchronous suspension>
#28 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#29 new Future.sync (dart:async/future.dart:222)
#30 CommandRunner.run (package:args/command_runner.dart:109)
#31 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:174)
#32 run.<anonymous closure> (package:flutter_tools/runner.dart:54)
<asynchronous suspension>
#33 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:142)
<asynchronous suspension>
#34 _rootRun (dart:async/zone.dart:1126)
#35 _CustomZone.run (dart:async/zone.dart:1023)
#36 runZoned (dart:async/zone.dart:1501)
#37 AppContext.run (package:flutter_tools/src/base/context.dart:141)
<asynchronous suspension>
#38 runInContext (package:flutter_tools/src/context_runner.dart:43)
<asynchronous suspension>
#39 run (package:flutter_tools/runner.dart:49)
#40 main (package:flutter_tools/executable.dart:49)
<asynchronous suspension>
#41 main (file:///b/build/slave/Mac_Flutter_Packaging/build/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8)
#42 _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#43 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)

flutter doctor

[✓] Flutter (Channel dev, v0.4.4, on Mac OS X 10.13.4 17E202, locale en-CN)
• Flutter version 0.4.4 at /Users/walker/Documents/libs/flutter
• Framework revision f9bb4289e9 (11 days ago), 2018-05-11 21:44:54 -0700
• Engine revision 06afdfe54e
• Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/walker/Documents/libs/android-sdk-macosx
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = /Users/walker/Documents/libs/android-sdk-macosx
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3, Build version 9E145
• ios-deploy 1.9.2
• CocoaPods version 1.5.2

[✗] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] VS Code (version 1.23.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension version 2.12.1

[✓] Connected devices (2 available)
• • b6fac6f62dbfba496a084ce56ddc80d94121385b • ios • iOS
• iPhone X • D98B467B-1756-436B-9DAF-98E915394BA3 • ios • iOS 11.3 (simulator)

! Doctor found issues in 1 category.

flutter analyze

flutter analyze
Analyzing animation...
No issues found! (ran in 1.8s)