Android .gitignore Template

The full, current Android .gitignore template — copy it as-is, or head to the .gitignore Generator to merge it with other stacks into one file.

Template

*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

# Log/OS Files
*.log

# Android Studio generated files and folders
captures/
output.json

# Keystore files
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json

# Android Profiling
*.hprof

What each entry does

Why every line in this template is excluded, not just what it matches.

Entry Why it's excluded
*.iml A JetBrains IDE module file, regenerated from the project structure — not meant to be shared.
.gradle Gradle's local cache and build state for the project — regenerated on the next build, and can be large.
/local.properties Android's machine-local SDK path configuration — genuinely different per developer machine, must not be shared.
/.idea/caches Excludes /.idea/caches — generated or machine-specific for this stack, not something to track in version control.
/.idea/libraries Excludes /.idea/libraries — generated or machine-specific for this stack, not something to track in version control.
/.idea/modules.xml Files matching /.idea/modules.xml — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
/.idea/workspace.xml Files matching /.idea/workspace.xml — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
/.idea/navEditor.xml Files matching /.idea/navEditor.xml — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
/.idea/assetWizardSettings.xml Files matching /.idea/assetWizardSettings.xml — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
.DS_Store macOS Finder's per-folder metadata file (icon positions, view settings) — pure OS clutter with no project value.
/build Compiled/bundled output directory produced by the build tool — derived entirely from source, not source itself.
/captures Android Studio's saved profiler/CPU/memory capture files — local debugging artifacts, not project source.
.externalNativeBuild Android Studio's cache for native (C/C++/NDK) build output — regenerated on the next build.
.cxx Android Studio's newer cache folder for native (CMake/NDK) build output — regenerated on the next build.
local.properties Android's machine-local SDK path configuration — genuinely different per developer machine, must not be shared.
*.log Runtime log output — grows unbounded, is different on every machine/run, and has no value in version control.
captures/ Android Studio's saved profiler/CPU/memory capture files — local debugging artifacts, not project source.
output.json Files matching output.json — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.jks A Java KeyStore file (commonly an Android signing key) — a secret credential, never commit it.
*.keystore An Android app-signing key — a secret; committing it would let anyone sign updates claiming to be your app.
google-services.json Firebase/Google Services config, often containing project-specific API keys — usually excluded to keep secrets and environment config out of git.
*.hprof A Java/Android heap-dump profiling snapshot — a large, machine-specific debugging artifact.