2

I am using several computers to work with my android project. Every time I am checking in my updates to GitHUB I see several files where updated even though I did not really update them, namely the *.iml files and .idea/misc.xml file. What changes is the value of the jdk-name attribute. While checkin ig from one computer it is '1.6 (2)', while from another it is just 'JDK'

My understanding is that something in the setup of JDK is different between my 2 computers. So what is different and how do I fix it?

mfeingold
  • 7,094
  • 4
  • 37
  • 43

1 Answers1

0

The JDK names are maintained internally in Android Studio; this is different from IntelliJ where you edit them through the Project Structure dialog.

It's not intended that you check .iml files or anything in the .idea folder into source control in Android Studio. The Gradle build files are the source of truth for project structure.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
  • Hmm... This is different from what other people are recommending: http://stackoverflow.com/questions/16640566/which-files-shouldnt-be-checked-in-into-version-control-in-android-studio – mfeingold Mar 19 '14 at 21:34
  • I just noticed your a Google engineer for android.tools. Can't get more authoritative then that. However I feel there's a oversight with your *.iml comment. When I don't include that file, other developers have to move heaven and earth to get either a new module or fresh clone compiling correctly. Most times they end up removing all module references from the app and settings gradle files, then re-adding them because Android Studio freaks out too much otherwise. – Ifrit Apr 14 '15 at 20:27
  • 1
    It rebuilds the .iml file every time you sync the project with Gradle files, which happens pretty often if you're modifying project structure. The Gradle build scripts really are the source of truth. If you're having that much trouble, then there's something else going on. – Scott Barta Apr 16 '15 at 14:44