IntelliJ IDEA: Cannot import SBT project

2019-01-24 03:00发布

I'm completely new to development using Play or IntelliJ for that matter. I've created a simple HelloWorld application using Activator, and this is an sbt project.

I've been trying to import this to IntelliJ and this is the screen I'm stuck at: https://www.dropbox.com/s/we1a4a3184sojvb/Screenshot%202014-07-24%2016.57.11.png

In almost all tutorials I've been through online, I've seen people using an sbt option on the import screen. I've installed the SBT plugin as well, but that hasn't helped. I've restarted IntelliJ several times to no avail.

Where am I going wrong? I'm running 13.1.4 with the SBT plugin installed.

7条回答
Deceive 欺骗
2楼-- · 2019-01-24 03:25

This issue is solved in the latest updates of the SBT and Scala plugins.

查看更多
地球回转人心会变
3楼-- · 2019-01-24 03:27

I had a similar problem which came from a different place than the other solutions here so adding it in case it occurs for others.

In my case the problem was caused by accidentally opening the IdeaProjects directory. When you do this, it creates the .Idea folder in that directory, and populates it as a project. This apparently also confuses the set import.

The solution is to remove the .Idea folder and open (not import) the directory again.

查看更多
相关推荐>>
4楼-- · 2019-01-24 03:30
  1. Uninstall everything
  2. Reinstall IntelliJ
  3. Install the JetBrains official Scala plugin
  4. Import the project

    • Make sure that the project has a build.sbt file in the right place, so that IntelliJ can find it as an SBT project.
    • This is about IntelliJ IDEA version 13.1.4.
查看更多
forever°为你锁心
5楼-- · 2019-01-24 03:37
  1. Move to /your-project-folder
  2. Run ./activator
  3. Type idea . It will generate IDEA project.
  4. Open (not import) File->Open.. project in IDEA.
查看更多
Anthone
6楼-- · 2019-01-24 03:37

I encountered the same error when I was trying to import a new scala project A to an existing IntelliJ project B as a module. I solved the problem by following step below:

  1. Go to your folder of project B. Open file .idea/sbt.xml.
  2. Deleting the entry which includes the path of project A.
查看更多
男人必须洒脱
7楼-- · 2019-01-24 03:44

I had this error when importing a new module from existing sources.

  • On the right-hand side of your IntelliJ window, you will see a list of vertical tabs, open the SBT tab.
  • Select the module that's causing trouble, right click on it, select "Detach external project"
  • Try to import the module again.
查看更多
登录 后发表回答