Unhandled exception: Could not import "package:dart_first/dart_first.dart"

创建dart项目时(用intelliJ IDEA创建的,Android Studio只能创建flutter工程,无法创建dart工程,打开和运行时没问题的),出现
Unhandled exception:
Could not import "package:dart_first/dart_first.dart" from "file:///Users/yinjn/Desktop/flutter/dart/dart_first/bin/main.dart": Could not resolve a package location for base at file:///Users/yinjn/Desktop/flutter/dart/dart_first/bin/main.dart
null

这是创建工程时,需要从google里下载东西,具体可以看Messages里的下载项,如果下载完了再运行就没问题了,如果不行可以尝试翻墙,或连手机热点吧。

你可能感兴趣的:(Unhandled exception: Could not import "package:dart_first/dart_first.dart")