Skip to content
Latchkey

Flutter "Flutter SDK not found" in CI

The Flutter SDK is not installed on the runner, or it is installed but not on PATH. Either way the toolchain that drives the build is missing.

What this error means

A step fails with "flutter: command not found" or the Android Gradle build reports "Flutter SDK not found. Define location with flutter.sdk in local.properties". Nothing builds because the SDK is absent.

CI log
Flutter SDK not found. Define location with flutter.sdk in the
local.properties file.
# or
./scripts/build.sh: line 2: flutter: command not found

Common causes

Flutter not installed on the runner

A bare runner image does not ship Flutter. Without a setup step, no flutter binary exists.

SDK present but not on PATH or in local.properties

Flutter was downloaded but its bin is not on PATH, or the Android build cannot find flutter.sdk in android/local.properties.

How to fix it

Install Flutter with the setup action

Use the maintained setup action so PATH and the SDK are configured for you.

.github/workflows/ci.yml
- uses: subosito/flutter-action@v2
  with:
    channel: stable
    flutter-version: '3.24.0'
- run: flutter --version

Put Flutter on PATH manually

If you install Flutter yourself, export its bin directory for later steps.

Terminal
git clone https://github.com/flutter/flutter.git -b stable --depth 1
echo "$PWD/flutter/bin" >> "$GITHUB_PATH"
flutter precache

How to prevent it

  • Use a Flutter setup action and pin the version.
  • Cache the Flutter SDK and pub cache keyed on your lockfile.
  • Run flutter doctor early to confirm the toolchain is present.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →