.gitignore for Android

19 ignore rules for Android, ready to copy into your repository.

Mobile operating system

The complete .gitignore for Android

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2025-09-16 20:49:16 UTC
# Technologies: Android

### Android ###
# Gradle cache
.gradle/
# Build output directory
build/
# Android local config
local.properties
# Log file
*.log
# Android captures
captures/
.externalNativeBuild/
.cxx/
# Android app bundle
*.aab
# Android package
*.apk
output-metadata.json
# IntelliJ module file
*.iml
# IntelliJ IDEA project files
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Java keystore
*.jks
# Android keystore
*.keystore
# Google services config
google-services.json
*.hprof

What these Android rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

Gradle files

Pattern What it ignores
.gradle/ Gradle cache
build/ Build output directory

Local configuration file (sdk path, etc)

Pattern What it ignores
local.properties Android local config

Log/OS Files

Pattern What it ignores
*.log Log file

Android Studio generated files and folders

Pattern What it ignores
captures/ Android captures
.externalNativeBuild/ Android Studio generated files and folders
.cxx/ Android Studio generated files and folders
*.aab Android app bundle
*.apk Android package
output-metadata.json Android Studio generated files and folders

IntelliJ

Pattern What it ignores
*.iml IntelliJ module file
.idea/ IntelliJ IDEA project files
misc.xml IntelliJ
deploymentTargetDropDown.xml IntelliJ
render.experimental.xml IntelliJ

Keystore files

Pattern What it ignores
*.jks Java keystore
*.keystore Android keystore

Google Services (e.g. APIs or Firebase)

Pattern What it ignores
google-services.json Google services config

Android Profiling

Pattern What it ignores
*.hprof Android Profiling

How to use this .gitignore for Android

  1. Copy the Android rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Operating System .gitignore templates

See every Operating System template