1

I am currently working on a Android Studio Project that I am sharing with other team mates. In order to do this we are using GitHub to share the Project.

I tried using the option "Check out project from Version Control". However one I successfully download and open the Project I get "Error Loading Project: Cannot load 2 modules", being two .iml files, one which is the app.iml. This prevents me from accessing the app folder from the project, hence I cannot work with it in Android Studio.

I have tried downloading it from our GitHub repository directly and opening it with Android Studio, however I get the same error.

Can anyone help me figure out how to successfully run a GitHub shared Android Studio project?

I am running this on Windows 10.

1
  • 1
    The iml files shouldn't be committed inside the repo because they have local path. Try to remove these file and build with gradle your project. Commented Feb 16, 2016 at 22:23

2 Answers 2

1

.iml files are the local configuration of the IDE, you and other team members should add it to .gitignore.

Also you can deleted them any time you want , and select Build Project from the Run menu. They will be generared again.

1

That's because .iml files are specific for local configurations. You have to remove them manually from the repository and not push them. I recommend to you to use a .gitignore file that can be either global or a project file with some classic Android excludes:

#built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Windows thumbnail db
Thumbs.db

# OSX files
.DS_Store

# Eclipse project files
.classpath
.project

# Android Studio
*.iml
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/

#NDK
obj/

Not the answer you're looking for? Browse other questions tagged or ask your own question.