TheAlgorithms / Scala

All Algorithms implemented in Scala
MIT License
1.08k stars 391 forks source link

Need help on import Scala project with IntellJ #56

Closed vdnhi closed 4 years ago

vdnhi commented 4 years ago

Did anyone met this error when importing Scala project into IntellJ?

[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.apache.logging.log4j#log4j-slf4j-impl;2.8.1: Resolution failed several times for dependency: org.apache.logging.log4j#log4j-slf4j-impl;2.8.1 {compile=[compile(*), master(*)], runtime=[runtime(*)]}::
[error]     Index 1 out of bounds for length 1
[error]     Index 1 out of bounds for length 1
[error]     Index 1 out of bounds for length 1
[error]
[error]     at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:331)
[error]     at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:205)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:229)
[error]     at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:190)
[error]     at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error]     at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error]     at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error]     at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error]     at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error]     at xsbt.boot.Using$.withResource(Using.scala:10)
[error]     at xsbt.boot.Using$.apply(Using.scala:9)
[error]     at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error]     at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error]     at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error]     at xsbt.boot.Locks$.apply(Locks.scala:28)
[error]     at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:185)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:182)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:228)
[error]     at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:190)
[error]     at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error]     at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error]     at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:38)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:91)
[error]     at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:104)
[error]     at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:104)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:87)
[error]     at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error]     at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:118)
[error]     at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2353)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:64)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:266)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.base/java.lang.Thread.run(Thread.java:835)
[error] (*:update) sbt.librarymanagement.ResolveException: unresolved dependency: org.apache.logging.log4j#log4j-slf4j-impl;2.8.1: Resolution failed several times for dependency: org.apache.logging.log4j#log4j-slf4j-impl;2.8.1 {compile=[compile(*), master(*)], runtime=[runtime(*)]}::
[error]     Index 1 out of bounds for length 1
[error]     Index 1 out of bounds for length 1
[error]     Index 1 out of bounds for length 1
Invalid response.

I didn't find any solution in the internet. It is very happy if I can fix this import error. Thank you.

Lxixnxuxs commented 4 years ago

Hi, Please make sure, that the Version described in the /project/build.properties matches the Version of your sbt, which is used by IntelliJ. You can check the Version of your IntelliJ-sbt, by opening the sbt shell-Tab in IntelliJ and searching for a Log-Message like: welcome to sbt <Version>.

vdnhi commented 4 years ago

Hi, I fixed this. Thank you.