Windows Build & Dependencies
Windows Build & Dependencies
Building Freak-Flix for Windows requires specific system configurations and external binary dependencies to handle high-performance video playback via media_kit.
๐ System Prerequisites
Before building, ensure your environment meets the following requirements:
- Visual Studio 2022: Install with the "Desktop development with C++" workload.
- Flutter SDK: The latest stable version configured for Windows desktop support.
flutter config --enable-windows-desktop - CMake: Usually bundled with Visual Studio, but ensure it is accessible in your PATH.
๐ฆ Mandatory Dependency: MPV
Freak-Flix utilizes media_kit for video rendering, which relies on the MPV library. The Windows executable will not launch without the mpv-1.dll available in the application path.
1. Obtain the DLL
You can download the pre-compiled shared libraries from the MPV Android/Windows builds or use the versions provided by the media_kit community.
2. Placement
For the application to run during development or after distribution, place mpv-1.dll in the following directory relative to your project root:
- Development:
build/windows/runner/Debug/(orRelease/) - Distribution: The same folder as
freak_flix.exe.
Note: Failure to include this file will result in a "Code execution cannot proceed because mpv-1.dll was not found" system error.
๐ Building the Project
Follow these steps to compile the Windows desktop application:
- Fetch Dependencies:
flutter pub get - Generate Plugins:
The project uses a custom C++ runner located in
windows/runner. Ensure plugin registration is updated:flutter create --platforms=windows . - Run in Debug Mode:
This will attach a console window (via
CreateAndAttachConsolein the runner) to view Flutter logs and MPV output.flutter run -d windows - Create Release Build:
flutter build windows
๐ฅ C++ Runner Configuration
The application includes a specialized Win32 runner (windows/runner/main.cpp) that handles:
- Console Attachment: Automatically attaches to the parent process console for logging when debugging.
- DPI Awareness: High-DPI scaling support via
EnableNonClientDpiScaling. - Theme Integration: Immersive Dark Mode support for the title bar window decorations.
If you modify the window behavior (e.g., initial size or transparency), updates should be made in flutter_window.cpp within the OnCreate method.
๐งช Troubleshooting
| Issue | Resolution |
| :--- | :--- |
| App crashes on startup | Verify mpv-1.dll is in the same folder as the .exe. Ensure you are using a 64-bit DLL for a 64-bit build. |
| No Video Output | Check if the GPU drivers are updated. Freak-Flix uses hardware acceleration by default. |
| Missing API Metadata | Ensure your TMDB API Key is correctly entered in the application settings; otherwise, the library scan will fail to populate UI elements. |
| Azure/OneDrive Login fails | Ensure your ms_auth_proxy is running (see Configuration) and the Redirect URI in Azure matches your local environment. |