-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityfound in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
Steps to reproduce
Create a workflow with the following steps:
- Set the
ANDROID_HOME
environment variable - Set up Flutter (with
subosito/flutter-action@v2
) - Run
flutter build apk
- Notice how it downloads the NDK into a different place than the location set in step 1
Expected results
The Android SDK location is set according to the ANDROID_HOME
environment variable.
Actual results
Flutter ignores the ANDROID_HOME
environment variable.
Code sample
Code sample
on:
workflow_dispatich:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- shell: bash
run: |
ANDROID_HOME="${{ runner.tool_cache }}/android"
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- uses: subosito/flutter-action@v2
with:
channel: stable
- shell: bash
run: flutter pub get
- shell: bash
run: flutter build apk
Logs
Logs
Run flutter build apk
flutter build apk
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
ANDROID_HOME: /Users/runner/hostedtoolcache/android
ANDROID_SDK_ROOT: /Users/runner/hostedtoolcache/android
JAVA_HOME: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/arm64/Contents/Home
JAVA_HOME_17_ARM64: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/arm64/Contents/Home
FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter/stable-3.32.2-arm64
PUB_CACHE: /Users/runner/.pub-cache
Your project is configured with Android NDK 26.3.11579264, but the following plugin(s) depend on a different Android NDK version:
Running Gradle task 'assembleRelease'...
- device_info_plus requires Android NDK 27.0.12077973
- flutter_blue_plus_android requires Android NDK 27.0.12077973
- path_provider_android requires Android NDK 27.0.12077973
- permission_handler_android requires Android NDK 27.0.12077973
- rive_common requires Android NDK 25.1.8937393
Fix this issue by using the highest Android NDK version (they are backward compatible).
Add the following to /Users/runner/work/IronOS_Companion/IronOS_Companion/android/app/build.gradle.kts:
android {
ndkVersion = "27.0.12077973"
...
}
Checking the license for package NDK (Side by side) 25.1.8937393 in /Users/runner/Library/Android/sdk/licenses
License for package NDK (Side by side) 25.1.8937393 accepted.
Preparing "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393".
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" ready.
Installing NDK (Side by side) 25.1.8937393 in /Users/runner/Library/Android/sdk/ndk/25.1.8937393
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" complete.
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" finished.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 4272 bytes (99.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Checking the license for package CMake 3.22.1 in /Users/runner/Library/Android/sdk/licenses
License for package CMake 3.22.1 accepted.
Preparing "Install CMake 3.22.1 v.3.22.1".
"Install CMake 3.22.1 v.3.22.1" ready.
Installing CMake 3.22.1 in /Users/runner/Library/Android/sdk/cmake/3.22.1
"Install CMake 3.22.1 v.3.22.1" complete.
"Install CMake 3.22.1 v.3.22.1" finished.
Running Gradle task 'assembleRelease'... 310.0s
✓ Built build/app/outputs/flutter-apk/app-release.apk (29.9MB)
Flutter Doctor output
Doctor output
Debug Flutter
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
ANDROID_HOME: /Users/runner/hostedtoolcache/android
ANDROID_SDK_ROOT: /Users/runner/hostedtoolcache/android
JAVA_HOME: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/arm64/Contents/Home
JAVA_HOME_17_ARM64: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/arm64/Contents/Home
FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter/stable-3.32.2-arm64
PUB_CACHE: /Users/runner/.pub-cache
$ flutter config --list
All Settings:
enable-web: (Not set)
enable-linux-desktop: (Not set)
enable-macos-desktop: (Not set)
enable-windows-desktop: (Not set)
enable-android: (Not set)
enable-ios: (Not set)
enable-fuchsia: (Not set) (Unavailable)
enable-custom-devices: (Not set)
cli-animations: (Not set)
enable-native-assets: (Not set) (Unavailable)
enable-swift-package-manager: (Not set)
explicit-package-dependencies: (Not set)
$ flutter doctor --verbose
[✓] Flutter (Channel stable, 3.32.2, on macOS 14.7.6 23H626 darwin-arm64, locale en-US) [3.6s]
• Flutter version 3.32.2 on channel stable at /Users/runner/hostedtoolcache/flutter/stable-3.32.2-arm64
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8defaa71a7 (3 days ago), 2025-06-04 11:02:51 -0700
• Engine revision 1091508939
• Dart version 3.8.1
• DevTools version 2.45.1
[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [6.5s]
• Android SDK at /Users/runner/Library/Android/sdk
• Platform android-36, build-tools 36.0.0
• ANDROID_HOME = /Users/runner/hostedtoolcache/android
• ANDROID_SDK_ROOT = /Users/runner/hostedtoolcache/android
• Java binary at: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.15-6/arm64/Contents/Home/bin/java
This JDK is specified by the JAVA_HOME environment variable.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment Temurin-17.0.15+6 (build 17.0.15+6)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 15.4) [6.3s]
• Xcode at /Applications/Xcode_15.4.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [15ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed) [14ms]
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/macos-android-setup for detailed instructions).
[✓] Connected device (2 available) [9.2s]
• macOS (desktop) • macos • darwin-arm64 • macOS 14.7.6 23H626 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 137.0.7151.56
[✓] Network resources [297ms]
• All expected network resources are available.
! Doctor found issues in 2 categories.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityfound in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform teamTriaged by Android platform team