flutter-android-build
Skill2 starsChanged 2 months agoMITView on GitHub
Use when building Flutter APKs for Android or modifying Glance-based home screen widgets.
In this repository58 other files it gives its agents.
- ad-hoc-script-verificationSkill
- architecture-diagramSkill
- blocked-page-recoverySkill
- cadquery-enclosure-designSkill
- canonical-thumbnailSkill
- circuit-designSkill
- competitor-news-monitorSkill
- component-alternativesSkill
- debugging-hermes-tui-commandsSkill
- docker-container-update-checkSkill
- document-to-action-itemsSkill
- docxSkill
- email-inbox-triageSkill
- embedded-porting-patternsSkill
- ephemeral-file-sharingSkill
- excalidrawSkill
- flash-game-researchSkill
- flutter-content-renderingSkill
- github-code-reviewSkill
- githubSkill
- goatcounter-analyticsSkill
- google-oauth-file-pollSkill
- grounded-citationsSkill
- hermes-agent-skill-authoringSkill
- hermes-gateway-slash-commandSkill
- hermes-gateway-supervisionSkill
- jellyseerr-watch-suggestionsSkill
- maintained-fork-publishingSkill
- meeting-action-itemsSkill
- native-mcpSkill
- obsidian-mapsSkill
- pdf-flattenSkill
- pdfSkill
- pdf-surgical-editsSkill
- planSkill
- product-price-monitorSkill
- psp-developmentSkill
- psp-homebrew-testingSkill
- psp-prx-plugin-maintenanceSkill
- python-debugpySkill
- python-webapp-patternsSkill
- reddit-readingSkill
- retro-fansiteSkill
- reverse-proxy-websocket-debuggingSkill
- rss-feedsSkill
- simplify-codeSkill
- sketchSkill
- skit-thumbnailSkill
- spikeSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- usb-device-enumerationSkill
- weekly-review-planningSkill
- wiki-media-asset-pipelineSkill
- windows-c-build-toolchainSkill
- windows-crash-forensicsSkill
- writing-plansSkill
- yt-dlp-anti-botSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Don't use for: iOS builds, or general Dart/UI rendering issues (see flutter-content-rendering for HTML/PDF/WebView content quirks)
- Distinctive: line 33
Update both of these together — they drift independently and Android will happily build with mismatched values, so nothing fails until a …
- Very specific: line 43
If a build ships with the old version despite a pubspec.yaml bump, check local.properties first before suspecting a Gradle cache issue.
- Distinctive: line 75
Test widget layout changes on-device or via Android Studio's widget preview — the Flutter app's own UI preview tools don't render Glance …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Android Build
Overview
Building Flutter APKs for Android and modifying Glance-based home screen
widgets (Jetpack Glance, the Compose-style widget toolkit Android apps use
for home_widget-style integrations).
When to Use
- Cutting a release/debug APK build for an Android Flutter app
- Bumping the app version ahead of a release
- Editing or debugging a Glance home screen widget shipped alongside the app
- Don't use for: iOS builds, or general Dart/UI rendering issues (see
flutter-content-renderingfor HTML/PDF/WebView content quirks)
Version Bumping
Update both of these together — they drift independently and Android will happily build with mismatched values, so nothing fails until a store upload or a widget update check compares them:
pubspec.yaml— theversion: X.Y.Z+Nline (X.Y.Zis the display version,Nafter the+is the build number /versionCode).android/local.properties— Flutter's Gradle plugin readsflutter.versionName/flutter.versionCodeoverrides from here if present; if the file pins a version it will silently take precedence overpubspec.yamlat build time.
If a build ships with the old version despite a pubspec.yaml bump, check
local.properties first before suspecting a Gradle cache issue.
Build Commands
flutter clean # when in doubt after a version/dependency change
flutter pub get
flutter build apk --release # single universal APK
flutter build apk --release --split-per-abi # smaller per-ABI APKs
flutter build appbundle --release # .aab for Play Store upload--split-per-abiproducesapp-armeabi-v7a-release.apk,app-arm64-v8a-release.apk,app-x86_64-release.apkseparately underbuild/app/outputs/flutter-apk/— don't sideload the wrong ABI onto a test device.- A release build requires a signing config (
android/key.properties+ matchingsigningConfigsblock inandroid/app/build.gradle); without it Gradle falls back to the debug keystore and the APK will fail to update over an existing store install (signature mismatch).
Glance Widget Pitfalls
- Glance widgets are native Kotlin/Compose code living under
android/app/src/main/kotlin/**/widget/, not Dart — Flutter hot reload does not touch them. Rebuild and reinstall the APK to see widget changes. A pure Dart-side hot reload will make it look like your widget edit "did nothing." - Widget state updates from the Dart side (e.g. via
home_widgetplugin) only take effect after you explicitly call the widget update trigger from Dart; changing shared prefs/files alone does not refresh a placed widget. - Test widget layout changes on-device or via Android Studio's widget preview — the Flutter app's own UI preview tools don't render Glance widgets.
Dart Pitfall
substringAfter() does not exist in Dart's String API (it's a
Kotlin/Guava-ism). Use .split("x").last instead, e.g.
"foo=bar".split("=").last → "bar".
Common Pitfalls
- Version mismatch between
pubspec.yamlandandroid/local.properties. See Version Bumping above — always grep both before assuming a version bug is a build-cache issue. - Expecting hot reload to update a Glance widget. It won't — widgets are native code, not Dart.
- Sideloading the wrong split APK. Match the device's ABI
(
arm64-v8afor virtually all modern phones) or install the universalapp-release.apkinstead. - Missing signing config on release builds. Falls back to the debug keystore silently; only surfaces as a signature-mismatch failure when updating an existing store install.
Verification Checklist
pubspec.yamlversion andandroid/local.properties(if present) agreeflutter build apk --release(orappbundle) completes with no errors- Release build is signed with the real keystore, not the debug fallback
- If a Glance widget was touched: APK reinstalled on-device, not just hot-reloaded, before judging the change
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

