Skip to content
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

Issue running new projects if an older environment (pre null safety) exists #91

Open
johnwiese-ms opened this issue Jul 18, 2024 · 2 comments

Comments

@johnwiese-ms
Copy link

I have an app that still uses Flutter 3.7.12 so I have that as an "old" environment. I also have the latest as "stable". At some point not that long ago I can no longer run newer (stable) projects. I see this output:

Resolving dependencies...
The current Dart SDK version is 2.19.6.

Because volleyball_hub requires SDK version >=3.3.4 <4.0.0, version solving failed.
pub get failed

The only way to resolve it is to delete the "old" environment.

@johnwiese-ms johnwiese-ms changed the title Issue running new projects if an older environment (pre null safety) exits Issue running new projects if an older environment (pre null safety) exists Jul 18, 2024
@johnwiese-ms
Copy link
Author

johnwiese-ms commented Jul 18, 2024

A little more detail is given when I run from terminal:

pub get failed
command: "/Users/johnwiese/.puro/envs/old/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --color
--directory . get --example"
pub env: {
  "FLUTTER_ROOT": "/Users/johnwiese/.puro/envs/old/flutter",
  "PUB_ENVIRONMENT": "flutter_cli:get",
  "PUB_CACHE": "/Users/johnwiese/.puro/shared/pub_cache",
}
exit code: 1

johnwiese@Johns-MacBook-Pro volleyball_hub % puro ls
[i] Environments:
    * stable (stable / 3.22.3 / b0850beeb2)
      beta   (not installed)
      master (not installed)
      old    (stable / 3.7.12 / 4d9e56e694)
      

Notice though that the output says FLUTTER_ROOT is set to "old" and not "stable", which is why I assume I am getting the error??

@johnwiese-ms
Copy link
Author

johnwiese-ms commented Jul 18, 2024

If I run puro version I get this output:

johnwiese@Johns-MacBook-Pro volleyball_hub % puro version
[!] Other Flutter or Dart installations detected
    Puro recommends removing the following from your PATH:
    * /Users/johnwiese/.puro/envs/old/flutter/bin//dart
    * /Users/johnwiese/.puro/envs/old/flutter/bin//flutter
[i] Puro 1.4.6 (distribution/darwin-x64)
    Dart 3.3.3 (stable) (Tue Mar 26 14:21:33 2024 +0000) on "macos_x64"

The problem is the only path setting I can find is in my .zshrc and doesn't have any of those entries:

export PATH="$PATH:$HOME/.puro/bin" # Added by Puro
export PATH="$PATH:$HOME/.puro/shared/pub_cache/bin" # Added by Puro
export PATH="$PATH:$HOME/.puro/envs/default/flutter/bin" # Added by Puro
export PURO_ROOT="/Users/johnwiese/.puro" # Added by Puro
export PUB_CACHE="/Users/johnwiese/.puro/shared/pub_cache" # Added by Puro
PATH=$PATH:/users/johnwiese/Library/Android/sdk

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

1 participant