# Sbt error Some keys were defined with the same name but different types

**URL:** <https://users.scala-lang.org/t/sbt-error-some-keys-were-defined-with-the-same-name-but-different-types/4585>\
**Category:** Question\
**Created:** [May 27, 2019, 7:07am UTC](https://users.scala-lang.org/t/sbt-error-some-keys-were-defined-with-the-same-name-but-different-types/4585 "2019-05-27T07:07:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimka](https://users.scala-lang.org/user_avatar/users.scala-lang.org/jimka/32/646_2.png) [@jimka](https://users.scala-lang.org/u/jimka)\
**Post date:** [May 27, 2019, 7:07am UTC](https://users.scala-lang.org/t/sbt-error-some-keys-were-defined-with-the-same-name-but-different-types/4585/1 "2019-05-27T07:07:07Z")

</div>

I did a git push from home, and a git pull from work. The main (I believe) that changed was a line was added to my `build.sbt` file.

![40](https://users.scala-lang.org/uploads/default/original/2X/c/ca6f52e9097011d929466cd6a80f7c23623d6277.png)  
IntelliJ notified me that I need to “Import Changes”. When I clicked “Import” I got the following error.

IntelliJ has an option to “Invalidate caches and restart…”. I tried that, but I still get the same error when I try to “Import Changes” again.

I’m appreciate any suggestion about how to figure out what’s happening, and how to fix it?

```auto
Error while importing sbt project:

[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt ...
[info] Loading global plugins from /Users/jnewton/.sbt/1.0/plugins
[info] Loading project definition from /Users/jnewton/scalain_e/scalain-e-course-code/project
[info] Loading settings for project scalain-e-course-code from build.sbt ...
[info] Set current project to scalain-e-course-code (in build file:/Users/jnewton/scalain_e/scalain-e-course-code/)
[info] sbt server started at local:///Users/jnewton/.sbt/1.0/server/952a20c74ae1365594d3/sock
sbt:scalain-e-course-code>
[info] Defining Global / sbtStructureOptions, Global / sbtStructureOutputFile and 1 others.
[info] The new values will be used by Global / dumpStructure, Global / ssOptions, cleanKeepFiles
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to scalain-e-course-code (in build file:/Users/jnewton/scalain_e/scalain-e-course-code/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from /Users/jnewton/Library/Application Support/IdeaIC2019.1/Scala/repo/org.jetbrains/sbt-structure-extractor/scala_2.12/sbt_1.0/2018.2.1+4-88400d3f/jars/sbt-structure-extractor.jar
[info] Reapplying settings...
[error] java.lang.RuntimeException: Some keys were defined with the same name but different types: 'ssExtractBuild' (sbt.Task[org.jetbrains.sbt.structure.BuildData], sbt.Task[org.jetbrains.sbt.structure.BuildData]), 'settingData' (sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.SettingData]], sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.SettingData]]), 'taskData' (sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.TaskData]], sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.TaskData]]), 'extractStructure' (sbt.Task[org.jetbrains.sbt.structure.StructureData], sbt.Task[org.jetbrains.sbt.structure.StructureData]), 'ssExtractDependencies' (sbt.Task[org.jetbrains.sbt.structure.DependencyData], sbt.Task[org.jetbrains.sbt.structure.DependencyData]), 'ssExtractProjects' (sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.ProjectData]], sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.ProjectData]]), 'ssExtractAndroid' (sbt.Task[scala.Option[org.jetbrains.sbt.structure.AndroidData]], sbt.Task[scala.Option[org.jetbrains.sbt.structure.AndroidData]]), 'ssExtractBuilds' (sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.BuildData]], sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.BuildData]]), 'ssExtractRepository' (sbt.Task[scala.Option[org.jetbrains.sbt.structure.RepositoryData]], sbt.Task[scala.Option[org.jetbrains.sbt.structure.RepositoryData]]), 'ssOptions' (org.jetbrains.sbt.Options, org.jetbrains.sbt.Options), 'commandData' (sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.CommandData]], sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.CommandData]]), 'ssExtractProject' (sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.ProjectData]], sbt.Task[scala.collection.Seq[org.jetbrains.sbt.structure.ProjectData]]), 'ssExtractPlay2' (sbt.Task[scala.Option[org.jetbrains.sbt.structure.Play2Data]], sbt.Task[scala.Option[org.jetbrains.sbt.structure.Play2Data]])
[error] at scala.sys.package$.error(package.scala:26)
[error] at sbt.internal.Index$.stringToKeyMap0(EvaluateConfigurations.scala:368)
[error] at sbt.internal.Index$.stringToKeyMap(EvaluateConfigurations.scala:355)
[error] at sbt.internal.Load$.structureIndex(Load.scala:335)
[error] at sbt.internal.Load$.reapply(Load.scala:350)
[error] at sbt.BuiltinCommands$.reapply(Main.scala:475)
[error] at org.jetbrains.sbt.CreateTasks$.reapply(CreateTasks.scala:65)
[error] at org.jetbrains.sbt.CreateTasks$.applySettings(CreateTasks.scala:56)
[error] at org.jetbrains.sbt.CreateTasks$.apply(CreateTasks.scala:47)
[error] at org.jetbrains.sbt.CreateTasks$.apply(CreateTasks.scala:11)
[error] at sbt.BasicCommands$.$anonfun$call$6(BasicCommands.scala:234)
...

```

---

<div class="post-metadata">

**Author:** ![jimka](https://users.scala-lang.org/user_avatar/users.scala-lang.org/jimka/32/646_2.png) [@jimka](https://users.scala-lang.org/u/jimka)\
**Post date:** [May 27, 2019, 7:36am UTC](https://users.scala-lang.org/t/sbt-error-some-keys-were-defined-with-the-same-name-but-different-types/4585/2 "2019-05-27T07:36:40Z")

</div>

There was [some discussion](https://stackoverflow.com/questions/47084795/strange-sbt-bug-where-i-cannot-import-sbt-project-due-to-keys-colliding-with-the) here about a similar problem. One person suggested to completely re-install IntelliJ. Someone else made an easier suggestion.

The suggestion was to change the preferences to “Use sbt shell [for imports] and [for builds]”.  
I initially had both these check-boxes as FALSE. I changed them to TRUE, as per the suggestion.

This seems to have magically fixed the problem.

 ![16](https://users.scala-lang.org/uploads/default/original/2X/a/aced72c079c5020f098151c87265645e43d40293.png)
