github/gitignore · Android.gitignore

Android .gitignore Template Explained

Why Android.gitignore ignores Gradle caches, build output, local.properties, APK/AAB, .idea, signing keystores and google-services.json, and how to decide.

Open in generator Open with Kotlin, Gradle, JetBrains, macOS

Android.gitignore is for app projects built with Android Studio and Gradle. It blocks Gradle build caches and output, SDK paths that only mean something on the developer's machine, and sensitive files such as app signing keys.

It differs from the JetBrains template in that it ignores the IDE folder .idea/ entirely. To share code style or run configurations with your team, you need to adjust this rule.

Rules explained

PatternWhat it ignores and why
.gradle/build/.kotlin/Gradle caches and buildsGradle task caches, per-module build output and Kotlin 2.0 plugin data. All are recreated.
local.propertiesLocal settingsContains the Android SDK/NDK install path (sdk.dir), so the value differs per person. Android Studio creates it automatically.
.externalNativeBuild/.cxx/Native buildsIntermediate folders created when building C/C++ code with CMake or ndk-build.
*.apk*.aaboutput-metadata.jsonApp packagesBuilt APKs and App Bundles and their metadata. They are handled by store uploads or the deployment pipeline.
*.iml.idea/misc.xmldeploymentTargetDropDown.xmlrender.experimental.xmlIDE filesAndroid Studio module files, the IDE settings folder, and files holding personal state such as the selected deployment target device.
*.jks*.keystoreSigning keysKeystores used to sign the app. If leaked, someone else could publish an app with the same signature, so keep them out of the repository.
google-services.jsonFirebase and Google services configContains the Firebase project identifiers and API key. It is not a secret key, but public repositories often exclude it; if excluded, CI has to supply it separately for the build to work.
captures/*.hprof*.logDiagnostic filesProfiler captures, heap dumps and logs. They are large and one-off.

Practical notes

Original template

Android.gitignore20 rules
# Gradle files.gradle/build/.kotlin/# Local configuration file (sdk path, etc)local.properties# Log/OS Files*.log# Android Studio generated files and folderscaptures/.externalNativeBuild/.cxx/*.aab*.apkoutput-metadata.json# IntelliJ*.iml.idea/misc.xmldeploymentTargetDropDown.xmlrender.experimental.xml# Keystore files*.jks*.keystore# Google Services (e.g. APIs or Firebase)google-services.json# Android Profiling*.hprof

Templates from github/gitignore/Android.gitignore @356fd7b (2026-09-11) · CC0-1.0

Often used together

More template explanations