1

This issue just recently (past couple days) started occurring on one of my development machines.

I'm using Eclipse's Vert.x dependency for a web project:

build.gradle

dependencies {
    ...
    // Kotlin
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
    // Vert.x for web framework
    compile group: 'io.vertx', name: 'vertx-core', version: '3.4.2'
    compile group: 'io.vertx', name: 'vertx-web', version: '3.4.2'
    ...
}

This has worked fine in the past - I think the triggering action was my upgrading to IntelliJ 2017.2.2, but now:

  1. IntelliJ cannot resolve any of the -web imports:

enter image description here

  1. If I examine the Dependencies list for my Module, the JavaScript version of the dependency is shown?

How did this happen, and how can I make sure it's properly recognized as a Java dependency?

enter image description here

Edit: Sample project available here: https://youtrack.jetbrains.com/issue/IDEA-177950

4
  • Just a hunch, try moving your Kotlin apply plugin ... lines to below the dependencies, and/or Kotlin compile ... lines to the end within the dependencies, and full gradle resync. Commented Aug 23, 2017 at 12:12
  • Please report at youtrack.jetbrains.com/issues/IDEA with the Minimal, Complete, and Verifiable example attached. Commented Aug 23, 2017 at 12:30
  • Thanks @CrazyCoder, if I can reproduce in a smaller project I will be sure to do so. Commented Aug 23, 2017 at 12:31
  • @CrazyCoder issue opened, youtrack.jetbrains.com/issue/IDEA-177950. I've also updated this question with the same project for anyone interested in toying. Commented Aug 23, 2017 at 13:18

2 Answers 2

3

This is a bug in the Kotlin plugin which is fixed in version 1.1.4-2. After you update the plugin, you need to delete the incorrect libraries and reimport your project from Gradle to have your project fixed.

Sign up to request clarification or add additional context in comments.

1 Comment

Indeed it is! As the JetBrains issue tracker is not publicly indexable, nothing came up in my searches. (And I searched less thoroughly through the tracker myself.) For reference, it is this issue: youtrack.jetbrains.com/issue/KT-19717
0

If you face such problems, the first two things you always can do is:

  1. (in IntellJ) File > Invalidate Caches/Restart
  2. (in IntellJ's Gradle Bar) Press button for Refresh all gradle dependencies

If this doesn't help, please check if ./gradlew clean testClasses succeeds or also fails with such an error.

2 Comments

Thanks, I tried all both, to no avail. The CLI build is fine - the dependency resolution seems to be isolated to IntelliJ.
Hm, that's really interesting. Just tried that out also with IntelliJ 2017.2.2 -> works perfectly fine. Can you provide your whole gradle file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.