I have a project cloned inside ubuntu wsl \\wsl$\Ubuntu\home\username\project
. Opened it inside Intellij IDEA Ultimate 2020.1.3 and tried to import as gradle project, but I am getting uninformative error message:
Here's my gradle config in IDEA:
The question is how should I open my project in IDEA then?
EDIT:
Logs from imported project contain this stack trace. Possibly this causes the issue.
org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-6.5.1-all.zip'.
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:139)
at org.jetbrains.plugins.gradle.GradleConnectorService$DistributionWrapper.getToolingImplementationClasspath(GradleConnectorService.kt:287)
at org.gradle.tooling.internal.consumer.loader.CachingToolingImplementationLoader.create(CachingToolingImplementationLoader.java:41)
at org.gradle.tooling.internal.consumer.loader.SynchronizedToolingImplementationLoader.create(SynchronizedToolingImplementationLoader.java:44)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.onStartAction(LazyConsumerActionExecutor.java:147)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:129)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:61)
at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor.lambda$run$0(DefaultAsyncConsumerActionExecutor.java:62)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Incorrect function
at java.base/sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
at java.base/sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:100)
at java.base/sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1161)
at java.base/java.nio.channels.FileChannel.tryLock(FileChannel.java:1165)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:55)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.tooling.internal.consumer.DistributionInstaller.install(DistributionInstaller.java:72)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:133)
... 15 more
EDIT2:
Attaching full logs of instantiating new project with gradle init
command:
https://pastebin.com/G4xhR3N3
There is a useful shortcut Ctrl + Shift + A , after which a window appears and you can type some command that you would like IntelliJ to run. Just type "sync" in there and it will find that command Sync Project with Gradle Files, even if it's not visible in the menu.
Workaround that was useful in my case (I have WSL 2):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With