简体   繁体   English

即使安装了包,它也没有显示在 dart 包文件夹中

[英]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 这是我的 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.

相关问题 Flutter 和 Dart 插件在降级 flutter 时未安装错误,即使它们已安装在 ZC31B32364CE1EC5CA8FCD1508A 上 - Flutter and Dart plugin not installed errror when downgrade flutter even though they are installed on android studio Flutter 说 Dart 版本是 2.13.4 即使它是 2.16.0 - Flutter says Dart version is 2.13.4 even though it's 2.16.0 外部库/Dart 包中手动删除的包不会重新出现 (Android Studio) - Manually deleted package in External Libraries/Dart Packages not reappearring (Android Studio) Dart Flutter DevTools“调试器”选项卡未显示 - Dart Flutter DevTools “Debugger” Tab not showing up Flutter with VSCode 显示未安装,即使已安装 - Flutter with VSCode shows not installed even though its installs Flutter 医生说 Flutter 插件没有安装,即使我有 - Flutter doctor says flutter plugins not installed even though I have 即使图像位于资产文件夹中,图像也不会显示在应用程序上 - image doesn't display on the app even though it was in assets folder 有没有办法为整个包/lib/文件夹设置`//@dart=2.12`? - Is there a way to set `//@dart=2.12` for an entire package/lib/folder? GET 请求在 http package ZC0617B10EEE7162B 的 Dart 中显示“406 - 不可接受” - GET request is showing “406 - Not Acceptable” in Dart for http package Flutter 在 Flutter 中出现“未引用声明”错误,即使它在 main.dart 中被引用 - Getting “The Declaration Isn't Referenced” error in Flutter even though it is referenced in main.dart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM