You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you using the Chinese community mirror or a corporate firewall?
Yes.
Problem
set PUB_HOSTED_URL=https://pub.flutter-io.cn
Init a dart project.
run pub get, generate a pubspec.lock file.
unset PUB_HOSTED_URL with unset PUB_HOSTED_URL
rerun pub get, then pubspec.lock file changed.
Not only the url changed, but also the version upgrade.
Expected behavior
Download the dependence from url and version recorded in pubspec.lock.
OR
Exit with error said PUB_HOSTED_URL not same with pubspec.lock used.
Actual behavior
pub get run success and changed pubspec.lock, which was not the behavior like the doc said. The doc said pub get use pubspec.lock, and there are pub upgrade and pub downgrade change pubspec.lock.
The text was updated successfully, but these errors were encountered:
I think it has nothing to do with pub hosted server.
Came across the same issue when I use a new flutter sdk version and an empty local pub cache.
Downgrade flutter sdk to the version when the lock file was generated solve this problem.
If you set flutter export path (path_to_flutter) both in ~/.zshrc and ~/.bash_profile,make sure you have added blew codes in both files, or only keep ~/.bash_profile configuration.
Environment
pub version
orflutter pub version
:Pub 2.4.1
Mac OS X 10.14.6
Yes.
Problem
PUB_HOSTED_URL=https://pub.flutter-io.cn
pub get
, generate apubspec.lock
file.PUB_HOSTED_URL
withunset PUB_HOSTED_URL
pub get
, thenpubspec.lock
file changed.Not only the
url
changed, but also theversion
upgrade.Expected behavior
url
andversion
recorded inpubspec.lock
.OR
PUB_HOSTED_URL
not same withpubspec.lock
used.Actual behavior
pub get
run success and changedpubspec.lock
, which was not the behavior like the doc said. The doc saidpub get
usepubspec.lock
, and there arepub upgrade
andpub downgrade
changepubspec.lock
.The text was updated successfully, but these errors were encountered: