Open Steffen70 opened 1 month ago
I found a seemingly related issue here: #322871.
After reviewing it, I tried adding FLUTTER_ROOT
in the shell hook, and now both dart run
and flutter pub run
work. However, I still get the same InvalidType
error when running the build (screenshot attached).
Could you please help investigate this?
Notify maintainers:
@babariviere
@ericdallo
@mkg20001
@RossComputerGuy
@FlafyDev
@hacker1024
What are you setting FLUTTER_ROOT
to?
I’m getting the original error again: Because spmobile depends on flutter_test from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.
This is the same error as when I don’t set FLUTTER_ROOT
at all. It looks like I need to set FLUTTER_ROOT
to the main Flutter directory (not bin
) for dart run
to work.
Issue:
dart run build_runner
Cannot Find Flutter SDK in NixpkgsEnvironment:
nixpkgs-flutter.url = "github:NixOS/nixpkgs/d4f247e89f6e10120f911e2e2d2254a050d0f732";
Description:
I am encountering an issue where running
dart run build_runner
does not work with the Flutter SDK from nixpkgs. It fails to locate the Flutter SDK, even though the app builds without any issues. However, when I switch to using Flutter installed via Homebrew, the command works as expected and the freezed models are generated successfully.Specifically:
dart run build_runner
results in an error that the Flutter SDK cannot be found.flutter pub run
does run, but it incorrectly sets the typeColor
toInvalidType
. This appears to happen becauseflutter pub run
internally runsdart run
, which cannot find the Flutter SDK.Steps to Reproduce:
dart run build_runner build --delete-conflicting-outputs
in a project that uses freezed models (no source code provided, but this should reproduce the issue).flutter pub run
and observe that theColor
type is set toInvalidType
, which is likely caused bydart run
not finding the Flutter SDK.Expected Behavior:
dart run build_runner
should find the Flutter SDK and generate freezed models without errors.InvalidType
when usingflutter pub run
.Actual Behavior:
dart run build_runner
cannot find the Flutter SDK.flutter pub run
sets theColor
type toInvalidType
.Affected Platforms:
Additional Information:
dart run build_runner
works as expected.