Reputation: 97
I have been having issues with installing this package https://pub.dev/packages/graphql_flutter/install one of it's dependencies is this graphql package https://pub.dev/packages/graphql. When i do pub get it installs en shows everything expect for the graphql package in the dart packages folders. I have tried to install the graphql package separately but the package still doesnt show up than. And the import still gives the error "Target of URI doesn't exist: '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. I have tried using flutter clean, flutter clean pub cache and androidstudio's invalidate caches/restart function to no avail. I have also tried restarting android studio and my pc multiple times. I have also tried it with androidstudio run as admin.
this is part of my Dart packages folder as you can see it does not show
And this is the pub.dartlang.org folder on my pc
Upvotes: 2
Views: 1670
Reputation: 103
Nothing is random !
if you accidentally delete the package from external package folder, it may have not update in caches.
so better you try invalidating caches or get it repaired. good to run the combo of two: flutter pub cache repair flutter pub get.
Upvotes: 0
Reputation: 61
Quick Solution
Upvotes: 2
Reputation: 41
Reloading VS code worked for me..
Reloading can be done ---> Command + R for Mac.
Upvotes: 0
Reputation: 1
Seen this issue a few times. Open Task manager in windows and check for adb.exe. There should be one copy running. I had 2 copies so removed 1 and restarted the other.
right-click --> end task for both.
All ok then.
Upvotes: 0
Reputation: 97
It ended up getting randomly fixed after 3 days. I just started android studio up and tried it again and suddenly it worked. No idea what fixed it in the end
Upvotes: 1