I'm trying to do the same. I took this project as an example https://gitlab.com/famedly/fluffychat/-/blob/main/.gitlab-ci.yml
I ended up with a job looking like this (in the .gitlab-ci.yml):
build_test_app_win_job:
stage: build
tags:
- shared-windows
- windows
- windows-1809
before_script:
# Install flutter (using Chocolatey and confirming all prompts)
- choco install flutter --confirm --no-progress
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- refreshenv
# Disable Google Analytics report for Flutter
- flutter config --no-analytics
script:
- cd test_app/
- flutter pub get
- flutter build windows -v >> debugCiLog.txt
However I'm stuck with a weird error during build (despite all being ok on my local computer):
[ +321 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 1. [C:\GitLab-Runner\builds\TestProject\test_app\build\windows\flutter\flutter_assemble.vcxproj]
With verbose on:
[ +74 ms] [ +8 ms] Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.
[ +8 ms] [ +3 ms]
[ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[ ] #1 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:295:7)
[ ] #2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1374:12)
[ ] <asynchronous suspension>
[ ] #3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
[ ] <asynchronous suspension>
[ ] #4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #5 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[ ] <asynchronous suspension>
[ ] #6 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
[ ] <asynchronous suspension>
[ ] #7 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #8 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[ ] <asynchronous suspension>
[ ] #9 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[ ] <asynchronous suspension>
[ ] #10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #11 main (package:flutter_tools/executable.dart:91:3)
[ ] <asynchronous suspension>
[ +2 ms] [ +67 ms] "flutter assemble" took 621ms.
[ ] [ +5 ms] ensureAnalyticsSent: 2ms
[ ] [ +1 ms] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ ] [ +6 ms] exiting with code 1
The following error is probably wrong, I can not find something relevant on google (I have no space or special character in the path):
Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.
Maybe this can help you despite I fail on my setup. I would be interested if you have more success than me
Also, I try flutter doctor
and all seems ok:
- Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.6.4)
- Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.17763.1339], locale en-US)