Android Studio The project is already registered

天大地大妈咪最大 提交于 2020-01-02 04:07:06

问题


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.

  1. As a precaution, take a backup of your project and store it safely
  2. Ensure that your project builds via gradle command-line and you have all required dependencies specified in respective build.gradle files. Try building with: gradle clean && gradle build
  3. Close the project in Android Studio (or close Android Studio)
  4. Delete .iml files and .idea folders from all modules and the main project
  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!