Flutter 踩坑 A package may not list itself as a dependency
Friday, Apr 10, 2020
在使用 Flutter 开发APP时, 运行flutter package get命令, 控制台报了 A package may not list itself as a dependency 的错误.
问题展示 运行flutter package get, 控制台报错如下:
Because my_app depends on my_app which doesn't exist (could not find package my_app at http://pub.dartlang.org), version solving failed. pub get failed (1; could not find package my_app at http://pub.dartlang.org) exit code 1 A package may not list itself as a dependency 原因 检查你的Flutter项目, 是否与即将导入的第三方库重名.
解决方案 方案一: 修改项目名 (推荐) 修改你的项目名称.