From a4b29d64140bf34943de0cf78827a5e0e05c4417 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 12 Oct 2017 14:46:37 -0700 Subject: [PATCH] Pass --enable_mirrors=false when building script snapshots for the debug mode. (#12472) The initial loading happens on the host, which was building a script snapshot and allowing imports of dart:mirrors. Hot reload happens on the device, which then notices the imports and issues a compile-time error. This change causes programs with imports of dart:mirrors to be rejected during the initial load. Fixes https://github.com/flutter/flutter/issues/12440 --- packages/flutter_tools/lib/src/base/build.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index 23bbb95336..dcb4ad14cd 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -167,6 +167,7 @@ class Snapshotter { final List args = [ '--snapshot_kind=script', '--script_snapshot=$snapshotPath', + '--enable-mirrors=false', mainPath, ];