7

Using Android Studio to make an app that uses Google Play Services for maps, I have to include the google-play-services library and also make sure there are some .jar files and all that jazz. I get this just fine, however, at work we use git for version control. If a different machine pulls down the files for said app from git, and that machine has a different location for the library needed, the user of this second machine has to reconfigure the project to use that machines libraries, and when that user pushes changes to git, the same has to be done for the next user. This makes it difficult, as one can imagine, to collaborate effectively and efficiently with multiple developers on the same project. Is there a best practices guide to make this easier or a setting or something I'm not familiar with?

4

1 回答 1

2

In general, you should not add files to version control that may have local settings. You should also mark these files to be ignored in .gitignore to prevent other developers from accidentally adding them to version control.

In my current projects I ignore the following files generated by Android Studio:

*.iml
*.ipr
*.iws
.idea/

However, I don't have the same situation as yours, because I'm not using any external libraries for now.

If that is not an option for you for some reason, you could try one of these workarounds:

  1. Add the external libraries to version control. Normally I'm against adding binaries to version control, but in this case it might be acceptable, especially if there are only a few such files.
  2. Use symbolic links: the library references are standardized in the project, and developers can either put the libraries to the designated location, or create symbolic links to point to their custom locations.
于 2013-08-10T07:01:14.943 回答