Could not resolve a package location for base at file:///E:/DartCode/untitled/bin/main.dart

创建Dart项目出现这样的错误:

Unhandled exception:
Could not import "package:untitled/untitled.dart" from "file:///E:/DartCode/untitled/bin/main.dart": Could not resolve a package location for base at file:///E:/DartCode/untitled/bin/main.dart

null

这个问题出现的原因是编译器从Google下载东西,然后失败导致的,解决方案就是需要在创建项目之前打开VPN

我使用的是蓝灯,下载地址:https://github.com/getlantern/lantern

如果觉得蓝灯不好用,可以试试FaTiaoYun(完全收费的,测试过很稳定)

然后如果还有这个错误,我们可以通过Build Project解决,一次Build不行多Build几次就可以了,如图:

 

猜你喜欢

转载自blog.csdn.net/lyh1299259684/article/details/80598673
今日推荐