Search code examples
gitandroid-studiogitignore

What folders should be ignored by Git in an Androidstudio Project


I am asking me , which folders should be explicitely be ignored by Git in a AndroidStudio Project ?

For example. Should ".idea" be ignored ?


Solution

  • Usually, you need to add .idea directory to your .gitignore because it is related to your Android Studio external plugin, except that your always relying on the external plugins for your project.

    This is your .gitignore should looks like (based on Android.gitignore, please read the comment):

    # Built application files
    *.apk
    *.ap_
    
    # Files for the ART/Dalvik VM
    *.dex
    
    # Java class files
    *.class
    
    # Generated files
    bin/
    gen/
    out/
    
    # Gradle files
    .gradle/
    build/
    
    # Local configuration file (sdk path, etc)
    local.properties
    
    # Proguard folder generated by Eclipse
    proguard/
    
    # Log Files
    *.log
    
    # Android Studio Navigation editor temp files
    .navigation/
    
    # Android Studio captures folder
    captures/
    
    # IntelliJ
    *.iml
    .idea/workspace.xml
    .idea/tasks.xml
    .idea/gradle.xml
    .idea/assetWizardSettings.xml
    .idea/dictionaries
    .idea/libraries
    .idea/caches
    
    # Keystore files
    # Uncomment the following line if you do not want to check your keystore files in.
    #*.jks
    
    # External native build folder generated in Android Studio 2.2 and later
    .externalNativeBuild
    
    # Google Services (e.g. APIs or Firebase)
    google-services.json
    
    # Freeline
    freeline.py
    freeline/
    freeline_project_description.json
    
    # fastlane
    fastlane/report.xml
    fastlane/Preview.html
    fastlane/screenshots
    fastlane/test_output
    fastlane/readme.md
    
    # Local configuration file (sdk path, etc)
    local.properties
    
    # Windows thumbnail db
    Thumbs.db
    
    # Windows desktop.ini
    desktop.ini
    
    # Linux configuration file
    .directory
    
    # OSX files
    .DS_Store
    
    # Don't include your google key, depends on your module name.
    /app/google-services.json
    /app/src/release/res/values/google_maps_api.xml