Flutter 踩坑 A package may not list itself as a dependency
今天在使用 Flutter 开发APP时, 运行flutter package get
命令, 控制台报了 A package may not list itself as a dependency 的错误.
问题展示
运行flutter package get
, 控制台报错如下:
Error on line 27, column 3 of pubspec.yaml: A package may not list itself as a dependency.
╷
27 │ location: ^2.3.5
│ ^^^^^^^^
╵
pub get failed (65; ╵)
原因
检查你的Flutter项目, 是否与即将导入的第三方库重名.
解决方案
- 修改你的项目名称. 这种方法虽然会很麻烦, 但是毕竟人家的项目先上传的😅😅. (推荐)
- 寻找功能相似的第三方库(不推荐)
对文章若有任何问题、异议以及改进建议, 欢迎在下方进行评论. 作者将尽快回复! 获取最新文章, 欢迎阅读官方博客.
更多更好的教程/博客/资讯, 欢迎访问我的官网: 阿航的技术小站.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。