KRTirtho / spotube

🎧 Open source Spotify client that doesn't require Premium nor uses Electron! Available for both desktop & mobile!
https://spotube.krtirtho.dev/
Other
26.42k stars 1.08k forks source link

Cannot build on Windows 10 enterprise. Flutter env.g.dart file not generated? #1519

Closed dearliuliu0522 closed 1 month ago

dearliuliu0522 commented 1 month ago

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"

  1. build log(do as document tells except first step cause I use Windows 10).

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...

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

KRTirtho commented 1 month ago

Please first read the Build from source guide

You didn't create the .env file with required credentials. Make sure to create the .env and then run build_runner build