Cannot build on Windows 10 enterprise. Flutter env.g.dart file not generated? #1520
Unanswered
dearliuliu0522
asked this question in
Q&A
Replies: 2 comments
-
Please first read the Build from source guide You didn't create the |
Beta Was this translation helpful? Give feedback.
0 replies
-
I encountered the same problem in Windows 11, but it has been solved. You can try adding configuration for flutter_gen in flutter_gen:
integrations:
flutter_localizations: true
output: lib/collections |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an existing issue for this?
Current Behavior
I want to build on my Windows 10 enterprise laptop,but get something wrong. Here is build error log:
[SEVERE] envied_generator:envied on lib/collections/env.dart:
Environment variable file doesn't exist at
.env
.package:spotube/collections/env.dart:7:16
╷
7 │ abstract class Env {
│ ^^^
╵
Expected Behavior
I don't know if Spotube cann't be build on Windows 10, or I do something wrong? If it's the later ,what should I do?
Steps to reproduce
1. My environment is below
PS D:\1_project\flutter\spotube> flutter doctor
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [版本 10.0.19045.4412], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2023.3)
[√] IntelliJ IDEA Ultimate Edition (version 2021.3)
[√] Connected device (4 available)
[√] Network resources
• No issues found!
PS C:\Users\admin> dart --version
Dart SDK version: 3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "windows_x64"
When I try to build Spotube, I get an error at the end. I upgrade some packages like envied etc. (suggested in https://stackoverflow.com/questions/76820607/flutter-env-g-dart-file-not-generated) but still not solve the problem. Here is my build log:
PS D:\1_project\flutter\spotube> flutter pub get
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Resolving dependencies... (11.5s)
Downloading packages...
! intl 0.19.0 (overridden)
! system_tray 2.0.2 (overridden) (2.0.3 available)
Changed 324 dependencies!
32 packages have newer versions incompatible with dependency constraints.
Try
flutter pub outdated
for more information.PS D:\1_project\flutter\spotube> dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns
Resolving dependencies in
D:\1_project\flutter\spotube
... (1.0s)Downloading packages... (1.3s)
Got dependencies in
D:\1_project\flutter\spotube
.Building package executable... (6.2s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 622ms
[INFO] Precompiling build script... completed, took 6.5s
FlutterGen v5.5.0+1 Loading ... pubspec.yaml
[INFO] Building new asset graph completed, took 2.2s
[INFO] Checking for unexpected pre-existing outputs. completed, took 4ms
[INFO] Generating SDK summary completed, took 6.3s
[WARNING] json_serializable on lib/models/connect/connect.dart:
The version constraint "^4.8.1" on json_annotation allows versions before 4.9.0 which is not allowed.
[SEVERE] envied_generator:envied on lib/collections/env.dart:
Environment variable file doesn't exist at
.env
.package:spotube/collections/env.dart:7:16
╷
7 │ abstract class Env {
│ ^^^
╵
[INFO] 54.3s elapsed, 1607/1608 actions completed.Generated: lib\collections\assets.gen.dart
FlutterGen finished.
[INFO] Running build completed, took 55.4s
[INFO] Caching finalized dependency graph completed, took 199ms
[SEVERE] Failed after 55.6s
Operating System
Window 10 Enterprise 22H2
Spotube version
v3.6.0
Installation source
GitHub Releases (Binary)
Additional information
No response
Self grab
Beta Was this translation helpful? Give feedback.
All reactions