What should be in my .gitignore for an Android Studio project?

后端 未结 30 3391
星月不相逢
星月不相逢 2020-11-22 04:23

What files should be in my .gitignore for an Android Studio project?

I\'ve seen several examples that all include .iml but IntelliJ docs sa

30条回答
  •  灰色年华
    2020-11-22 04:54

    Building on my normal Android .gitignore, and after reading through documentation on the Intellij IDEA website and reading posts on StackOverflow, I have constructed the following file:

    # built application files
    *.apk
    *.ap_
    
    # files for the dex VM
    *.dex
    
    # Java class files
    *.class
    
    # built native files (uncomment if you build your own)
    # *.o
    # *.so
    
    # generated files
    bin/
    gen/
    
    # Ignore gradle files
    .gradle/
    build/
    
    # Local configuration file (sdk path, etc)
    local.properties
    
    # Proguard folder generated by Eclipse
    proguard/
    
    # Eclipse Metadata
    .metadata/
    
    # Mac OS X clutter
    *.DS_Store
    
    # Windows clutter
    Thumbs.db
    
    # Intellij IDEA (see https://intellij-support.jetbrains.com/entries/23393067)
    .idea/workspace.xml
    .idea/tasks.xml
    .idea/datasources.xml
    .idea/dataSources.ids
    

    Also note that as pointed out, the built native files section is primarily useful when you are building your own native code with the Android NDK. If, on the other hand, you are using a third party library that includes these files, you may wish to remove these lines (*.o and *.so) from your .gitignore.

提交回复
热议问题