This document provides a comprehensive guide for setting up professional Flutter development on ChromeOS with Android build capabilities and wireless debugging.
This guide documents the complete setup process for Flutter development on ChromeOS, including:
# Create development directory
mkdir -p ~/development
cd ~/development
# Download Flutter stable channel
wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.32.8-stable.tar.xz
# Extract Flutter
tar xf flutter_linux_3.32.8-stable.tar.xz
# Add Flutter to PATH (add to ~/.bashrc for permanence)
export PATH="$HOME/development/flutter/bin:$PATH"
# Verify installation
flutter --version
flutter doctor
Expected issues on fresh ChromeOS installation:
ChromeOS Linux containers have specific challenges for Android development:
# Create SDK directory in user space
mkdir -p ~/android-sdk-complete
cd ~/android-sdk-complete
# Download complete Android command-line tools
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
# Extract and set up proper structure
unzip commandlinetools-linux-11076708_latest.zip
mkdir -p cmdline-tools/latest
mv cmdline-tools/{bin,lib,NOTICE.txt,source.properties} cmdline-tools/latest/
# Make tools executable
chmod +x cmdline-tools/latest/bin/*
# Set environment for SDK operations
export ANDROID_HOME=~/android-sdk-complete
export ANDROID_SDK_ROOT=~/android-sdk-complete
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
# Install platform tools
~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager "platform-tools"
# Install build tools and platforms
~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0"
~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager "platforms;android-34"
~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager "platforms;android-35"
# Install NDK versions (both required for Flutter)
~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager "ndk;27.0.12077973" # Plugin requirement
~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager "ndk;26.3.11579264" # Build requirement
# Accept all licenses
yes | ~/android-sdk-complete/cmdline-tools/latest/bin/sdkmanager --licenses
# Add to ~/.bashrc for permanent configuration
cat >> ~/.bashrc << 'EOF'
# Android SDK Configuration - Complete SDK
export ANDROID_HOME=/home/kmcisaac/android-sdk-complete
export ANDROID_SDK_ROOT=/home/kmcisaac/android-sdk-complete
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
EOF
# Reload environment
source ~/.bashrc
# Configure Flutter to use our complete SDK
flutter config --android-sdk $ANDROID_HOME
# Verify configuration
flutter doctor
Expected result after setup:
[✓] Flutter (Channel stable, 3.32.8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Linux toolchain - develop for Linux desktop
# Download latest platform tools with wireless pairing support
mkdir -p ~/platform-tools-new
cd ~/platform-tools-new
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip
# Verify wireless capability
~/platform-tools-new/platform-tools/adb --version
# One-time pairing (Android 11+)
~/platform-tools-new/platform-tools/adb pair PAIRING_IP:PORT PAIRING_CODE
# Daily connection
~/platform-tools-new/platform-tools/adb connect DEVICE_IP:PORT
# Verify connection
~/platform-tools-new/platform-tools/adb devices
flutter devices
# Download Android Studio
cd ~/
wget https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2024.2.1.13/android-studio-2024.2.1.13-linux.tar.gz
# Extract
tar -xzf android-studio-2024.2.1.13-linux.tar.gz
# Create desktop entry
mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/android-studio.desktop << 'EOF'
[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Icon=/home/kmcisaac/android-studio/bin/studio.png
Exec=/home/kmcisaac/android-studio/bin/studio.sh
Comment=Android Studio IDE
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-studio
EOF
chmod +x ~/.local/share/applications/android-studio.desktop
/home/kmcisaac/android-sdk-completeMany Flutter projects have NDK version conflicts. Fix in android/app/build.gradle.kts:
android {
namespace = "com.example.app"
compileSdk = flutter.compileSdkVersion
ndkVersion = "27.0.12077973" // Specify exact version instead of flutter.ndkVersion
// ... rest of configuration
}
In android/gradle.properties:
# Optimize for ChromeOS container memory constraints
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:ReservedCodeCacheSize=256m
android.useAndroidX=true
android.enableJetifier=true
# Ensure correct SDK paths
android.sdk.home=/home/kmcisaac/android-sdk-complete
android.ndk.home=/home/kmcisaac/android-sdk-complete/ndk/27.0.12077973
In android/local.properties:
flutter.sdk=/path/to/flutter
sdk.dir=/home/kmcisaac/android-sdk-complete
android.sdk.home=/home/kmcisaac/android-sdk-complete
android.ndk.home=/home/kmcisaac/android-sdk-complete/ndk/27.0.12077973
File: connect-android.sh
#!/bin/bash
DEVICE_IP="192.168.86.250"
DEVICE_PORT="35933"
echo "Connecting to Android device..."
~/platform-tools-new/platform-tools/adb connect $DEVICE_IP:$DEVICE_PORT
if ~/platform-tools-new/platform-tools/adb devices | grep -q "device$"; then
echo "✅ Device connected"
flutter devices | grep -i android
else
echo "❌ Connection failed"
fi
File: setup-flutter-env.sh
#!/bin/bash
# Set up complete Flutter development environment
# Android SDK
export ANDROID_HOME=~/android-sdk-complete
export ANDROID_SDK_ROOT=~/android-sdk-complete
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
# Flutter
export PATH="$HOME/development/flutter/bin:$PATH"
echo "Environment configured:"
echo "Flutter: $(flutter --version | head -1)"
echo "Android SDK: $ANDROID_HOME"
echo "Connected devices:"
flutter devices
File: deploy-debug.sh
#!/bin/bash
# Build and deploy debug APK wirelessly
set -e
# Configure environment
export ANDROID_HOME=~/android-sdk-complete
export ANDROID_SDK_ROOT=~/android-sdk-complete
DEVICE_IP="192.168.86.250:35933"
echo "Building debug APK..."
flutter build apk --debug --target-platform android-arm64
echo "Installing to device..."
~/platform-tools-new/platform-tools/adb -s $DEVICE_IP install -r build/app/outputs/flutter-apk/app-debug.apk
echo "Starting app..."
~/platform-tools-new/platform-tools/adb -s $DEVICE_IP shell am start -n com.example.app/com.example.app.MainActivity
echo "✅ App deployed and started!"
# Increase container memory if possible (requires restart)
# In ChromeOS settings: Advanced → Developers → Linux development environment → Manage
# Monitor memory usage during builds
htop
# Clear build caches regularly
flutter clean
rm -rf ~/.gradle/caches/
# Use specific architecture for faster builds
flutter build apk --debug --target-platform android-arm64
# Skip unnecessary targets
flutter build apk --debug --no-tree-shake-icons
# Parallel builds (gradle.properties)
org.gradle.parallel=true
org.gradle.daemon=true
Problem: Flutter plugins require different NDK versions Solution: Install both required NDK versions and specify in build.gradle.kts
Problem: Trying to use system SDK directories
Solution: Use complete user-controlled SDK at ~/android-sdk-complete
Problem: Memory constraints in ChromeOS container Solution: Reduce Gradle memory allocation or use Android Studio
Problem: ADB connection issues or network problems Solution: Check wireless debugging settings, restart ADB, verify network
Problem: Large builds exceeding time limits Solution: Use Android Studio for builds, or external build server
# List all devices
~/platform-tools-new/platform-tools/adb devices
# Deploy to specific device
flutter run -d DEVICE_ID
# Multiple wireless connections
~/platform-tools-new/platform-tools/adb connect 192.168.1.100:5555
~/platform-tools-new/platform-tools/adb connect 192.168.1.101:5555
# Use VS Code remote development
code --remote ssh-remote+user@server /path/to/project
# Sync with external build server
rsync -avz project/ server:~/project/
ssh server "cd ~/project && flutter build apk"
scp server:~/project/build/app/outputs/flutter-apk/app-debug.apk .
# Monitor Android device performance
~/platform-tools-new/platform-tools/adb shell top
# Flutter performance tools
flutter analyze
flutter test
dart analyze
.gitignore to exclude build artifactsThis setup provides a complete Flutter development environment on ChromeOS with:
The key to success on ChromeOS is using a complete, user-controlled Android SDK that avoids system limitations and configuration conflicts. With this setup, ChromeOS becomes a fully capable mobile development platform.