Skip to content

pub get fails to "package doesn't exist" in Windows #2858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kinex opened this issue Jan 31, 2021 · 2 comments
Closed

pub get fails to "package doesn't exist" in Windows #2858

kinex opened this issue Jan 31, 2021 · 2 comments

Comments

@kinex
Copy link

kinex commented Jan 31, 2021

I have this git reference in my pubspec.yaml:

in_app_purchase:
  git:
    url: https://github.com/kinex/plugins
    ref: 0c9010bbc2a6537dc5089ce65c7c8ac092b62512
    path: packages/in_app_purchase

flutter pub get works without issue in Mac, but in Windows I get this error:

Package doesn't exist (the pubspec for in_app_purchase 0.3.5+1 from git has version 0.3.4+3).
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Package doesn't exist (the pubspec for in_app_purchase 0.3.5+1 from git has version 0.3.4+3).
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
.
.

If I comment out the "ref:" line, pub get works also in Windows. The referenced commit is in a branch (not master).

Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9b2d32b605 (9 days ago) • 2021-01-22 14:36:39 -0800
Engine • revision 2f0af37152
Tools • Dart 2.10.5
@sigurdm
Copy link
Contributor

sigurdm commented Feb 1, 2021

Hmm - I cannot reproduce.

I get a resolution on windows with the following pubspec.yaml also using flutter 1.22.6 stable:

name: blah
environment:
  sdk: ">=2.3.0 <3.0.0"

dependencies:
  in_app_purchase:
    git:
      url: https://github.com/kinex/plugins
      ref: 0c9010bbc2a6537dc5089ce65c7c8ac092b62512
      path: packages/in_app_purchase

Maybe something got borked in your cache...

Try deleting everything in flutter/.pub-cache/git/ before doing another pub get.

@kinex
Copy link
Author

kinex commented Feb 1, 2021

Thanks, it helped.

Not sure if it was related, but I noticed I had also "Filename too long" issue described here. I got that error after clearing the cache and then tried running pub get again. Surprising that I have still been able to create and publish APKs.

Another possible reason for this issue was that my pub cache was under %APPDATA% which is a roaming folder and I have used Flutter in two Windows machines with the same account. I am not sure how well the roaming works, maybe it has messed the cache at some point. I found #2297 and now moved my cache under %LOCALAPPDATA%.

@kinex kinex closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants