I'm trying to build a Flutter application for MacOS desktop using GitHub Actions. But I get the following error output:
.../build/macos/Build/Intermediates.noindex/Runner.build/Release/Runner.build/Script-3399D490228B24CF009A79C7.sh: line 3:
.../macos/../.fvm/flutter_sdk/packages/flutter_tools/bin/macos_assemble.sh: No such file or directory
It has something to do with fvm which I'm using locally, but not on GitHub Actions.
So I looked into the 'Script-3399D490228B24CF009A79C7.sh' which is a generated file obviously. Its content is:
#!/bin/sh
export FLUTTER_ROOT="$PROJECT_DIR/../.fvm/flutter_sdk"
echo "$PRODUCT_NAME.app" > "$PROJECT_DIR"/Flutter/ephemeral/.app_filename && "$FLUTTER_ROOT"/packages/flutter_tools/bin/macos_assemble.sh embed
How can I control how this file and especially the FLUTTER_ROOT
variable is generated.
I tried configuring my local setup without using fvm and it builds fine but not on GitHub Actions.
My FLUTTER_ROOT
which is defined in Xcode build settings has the value /Users/.../dev/flutter
so no .fvm
there.
I've searched my project for FLUTTER_ROOT
and found out that there was a line in macos/Runner.xcodeproj/project.pbxproj
where it said:
shellScript = "export FLUTTER_ROOT=\"$PROJECT_DIR/../.fvm/flutter_sdk\"\n ... "
I simply removed it and everything worked.