Common Flutter Development Problems and Fixes
Flutter build problems often involve several layers at once: the Flutter SDK, Dart, Gradle, Android build tools, repositories, and package versions. Record flutter doctor -v, the complete error stack, and reproducible steps before changing caches or mirrors.
Download Flutter
A Windows stable archive can be downloaded from the official release storage:
https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.29.2-stable.zip
Verify the current stable version before installation.
Configure package mirrors
In environments where the default endpoints are slow, configure approved mirrors:
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
PUB_HOSTED_URL=https://pub.flutter-io.cn
Diagnose a slow assembleDebug
cd android
.\gradlew.bat clean
.\gradlew.bat assembleDebug --info
Use the verbose output to identify the dependency or repository causing the delay. Avoid manually copying artifacts into Gradle caches unless you fully understand the expected directory and checksum layout.
Configure the Gradle distribution
Edit android/gradle/wrapper/gradle-wrapper.properties:
# distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.10.2-all.zip
Configure a Maven mirror
For Kotlin DSL projects, edit android/build.gradle.kts or the repository-management block used by the project:
maven { url = uri("https://mirrors.tencent.com/nexus/repository/maven-public/") }
Create a project
flutter create my_app
cd my_app
flutter run
Keep Flutter, Android Gradle Plugin, Gradle, Kotlin, and Java versions compatible rather than upgrading them independently.