diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 4b69371e8e..1193a9a1b9 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -117,7 +117,11 @@ class PackageUriMapper { for (String packageName in packageMap.keys) { final String prefix = packageMap[packageName].toString(); - if (fileSystemScheme != null && fileSystemRoots != null && prefix.contains(fileSystemScheme)) { + // Only perform a multi-root mapping if there are multiple roots. + if (fileSystemScheme != null + && fileSystemRoots != null + && fileSystemRoots.length > 1 + && prefix.contains(fileSystemScheme)) { _packageName = packageName; _uriPrefixes = fileSystemRoots .map((String name) => Uri.file(name, windows: platform.isWindows).toString())