问题
I've a big problem with Android Studio. I have a project that depends on two other projects (as libs). I followed the guide Problems importing project into Android Studio regarding ActionBarSherlock for import external modules. I opened "Project Structure", imported the module, but after that I can't see it in the Modules area. The Modules area contains only the root module, seems it is not refreshed (this is strange). So if I try to add the module as a Dependency, Android Studio doesn't find any module!
Then, if I try to re-import the module, it says that the module/project is already registered!! Maybe I'm missing something, but I don't know what....! I have this problem both on Windows and MacOSX.
Thanks in advance, Federico
回答1:
Look around in your .idea directory for mentions of the problematic project. I had the same problem and resolved it by deleting the entry from .idea/sbt.xml.
回答2:
In ij go to menu: View -> Tool Windows-> Gradle Right click on the problematic module and click Refresh External Project, You should see the module in project explorer.
回答3:
I had a similar problem with ABS and other library imports. The 'Project Structure' interface just wouldn't show the modules. On trying to import the modules, it would prompt, "The project is already registered". Seems to be an IntelliJ/Android Studio issue. Invalidate Caches option didn't help.
Reimporting the project after some cleanup did work for me.
- As a precaution, take a backup of your project and store it safely
- Ensure that your project builds via gradle command-line and you have all required dependencies specified in respective
build.gradlefiles. Try building with:gradle clean && gradle build - Close the project in Android Studio (or close Android Studio)
- Delete
.imlfiles and.ideafolders from all modules and the main project - Start Android Studio and reimport the project (Import project from external model > Gradle)
回答4:
you should remove the project from respective gradle/sbt/maven/ant tab (used to be on right vertical line of Android Studio/Intellij IDEA)
See this answer: https://stackoverflow.com/a/30442195/907576
来源:https://stackoverflow.com/questions/17406249/android-studio-the-project-is-already-registered