[英]Package is not showing up in the dart packages folder even though it is installed
I have been having issues with installing this package https:\/\/pub.dev\/packages\/graphql_flutter\/install<\/a> one of it's dependencies is this graphql package https:\/\/pub.dev\/packages\/graphql<\/a> .我在安装这个包
https:\/\/pub.dev\/packages\/graphql_flutter\/install<\/a>时遇到了问题,它的依赖项之一是这个 graphql 包https:\/\/pub.dev\/packages\/graphql<\/a> 。 When i do pub get it installs en shows everything expect for the graphql package in the dart packages folders.
当我做 pub get it installs 时,它会显示 dart 包文件夹中 graphql 包的所有期望。 I have tried to install the graphql package separately but the package still doesnt show up than.
我曾尝试单独安装 graphql 包,但该包仍然没有显示出来。 And the import still gives the error "Target of URI doesn't exist: 'package:graphql\/client.dart'."
并且导入仍然给出错误“URI目标不存在:'package:graphql\/client.dart'。” But it does show up in flutter\/.pub-cache\/hosted\/pub.dartlang.org so i dont understand why it doesnt show in my project.
但它确实出现在 flutter\/.pub-cache\/hosted\/pub.dartlang.org 中,所以我不明白为什么它没有出现在我的项目中。 I have tried using flutter clean, flutter clean pub cache and androidstudio's invalidate caches\/restart function to no avail.
我尝试过使用flutter clean、flutter clean pub cache和androidstudio的invalidate caches\/restart功能,但无济于事。 I have also tried restarting android studio and my pc multiple times.
我也尝试过多次重启 android studio 和我的电脑。 I have also tried it with androidstudio run as admin.
我也尝试过以管理员身份运行 androidstudio。
This is my pubspec.yaml这是我的 pubspec.yaml
<\/a>
this is part of my Dart packages folder as you can see it does not show这是我的 Dart 包文件夹的一部分,你可以看到它没有显示
<\/a>
And this is the pub.dartlang.org folder on my pc这是我电脑上的 pub.dartlang.org 文件夹<\/a>
Seen this issue a few times.看到这个问题好几次了。 Open Task manager in windows and check for adb.exe.
在 Windows 中打开任务管理器并检查 adb.exe。 There should be one copy running.
应该有一个副本在运行。 I had 2 copies so removed 1 and restarted the other.
我有 2 个副本,因此删除了 1 个并重新启动了另一个。
right-click --> end task for both.右键单击 --> 结束两者的任务。
All ok then.那么一切都好。
It ended up getting randomly fixed after 3 days.它最终在 3 天后得到随机修复。 I just started android studio up and tried it again and suddenly it worked.
我刚刚启动了 android studio 并再次尝试,突然它起作用了。 No idea what fixed it in the end
不知道最后是怎么解决的
Reloading VS code worked for me..重新加载VS代码对我有用..
Reloading can be done ---> Command + R<\/strong> for Mac.可以重新加载 ---> Mac 的Command + R。<\/strong>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.