Development in Android Studio on two computers - and app.iml always change

I am developing an Android application on two computers (using git for synchronization) - Windows 7 and Mac OS Yosemite.

For some reason, the app.iml file always changes when you open a project:

diff screenshot

Sorting dependencies in build.gradle alphabetically did not help:

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:design:23.0.1' compile 'com.android.support:recyclerview-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.facebook.android:facebook-android-sdk:4.1.0' compile 'com.google.android.gms:play-services-gcm:7.8.0' compile 'com.google.android.gms:play-services-plus:7.8.0' compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.vk:androidsdk:1.5.10' compile 'de.hdodenhof:circleimageview:1.3.0' } 

Is there anything you can do here? So I am not forced to commit the modified file again and again?

I am using .gitignore for Android recommended by GitHub.

+5
source share
1 answer

Add it to your .gitignore file. Then run git rm --cached app.iml so that it is no longer tracked from this point. Given that you use Gradle for your dependencies, all other local Android Studio installations should work with this, and not with the general app.iml .

Although there are some JetBrains / IntelliJ / Android Studio project files that you can put in the source control, my constant recommendation is not for this reason: you will have many changes to those files that are not related to the production code itself.

+1
source

All Articles