Swapping Flutter SDKs via IDE doesn't work with web builds.
See original GitHub issueI just got off a chat with @DanTup, who asked me to file an issue on this. Set up: I have three Flutter SDKs installed: /stable - my main SDK, which my PATH points to / dev - downloaded from https://flutter.dev/docs/development/tools/sdk/releases /master - checked out via git
I want to be able to use the stable SDK for my mobile app, and the dev SDK for playing around with flutter web.
If I use flutter channel dev
to change my main SDK, and then debug a web project, then it will compile and launch correctly.
However, if my main SDK is on the stable
channel, and I use the SDK chooser in VSCode (bottom bar) to select the dev
channel SDK, then it will generate the following errors when I debug:
Error: Error when reading '../../_SDKs/dev/packages/flutter_tools/.packages': No such file or directory
I checked, and that file does not exist. It does exist in my main SDK if I use flutter channel
to swap it to dev. I did run 'Flutter: Run Flutter Upgrade` against the /dev SDK, but that didn’t fix anything. Both are SDK v1.10.4.
Given all of that, I’m not sure if this is an issue with the VSCode plugin, the package from the SDK download page, or if I should be running some command against the downloaded SDK in order to generate the .packages
file.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
One way to verify this would be to run
flutter update-packages
and then re-run, it should workYeah, spot on. Running
update-packages
for that version of Flutter solves the issue.I’ve opened https://github.com/flutter/flutter/issues/41681 to track this, since I presume this should be handled inside Flutter (either automatically, or by the packages file being in zips).