Problem with Gradle

Currently I restart my work on the Kotlin support for RxJava.

And now I have a problem with the gradle build system (not sure if is my build.gradle or the plugin)

When I try to run /gradlew I get this error

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/Users/mario/IdeaProjects/KotlinProjects/rx/rx4/RxJava/language-adaptors/rxjava-kotlin/build.gradle’ line: 1

  • What went wrong:
    A problem occurred evaluating project ‘:language-adaptors:rxjava-kotlin’.
    > Could not resolve all dependencies for configuration ‘detachedConfiguration1’.
      > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin-core:0.6.350.
      Required by:
      com.netflix.rxjava:rxjava-kotlin:0.13.5-SNAPSHOT

The only difference that I can see is that my kotlin module is a sub module

apply plugin: 'kotlin' apply plugin: 'osgi'

dependencies {
  compile project(‘:rxjava-core’)
  compile ‘org.jetbrains.kotlin:kotlin-stdlib:0.6.+’
  provided ‘junit:junit-dep:4.10’
  provided ‘org.mockito:mockito-core:1.8.5’
}

jar {
  manifest {
  name = ‘rxjava-kotlin’
  instruction ‘Bundle-Vendor’, ‘Netflix’
  instruction ‘Bundle-DocURL’, ‘https://github.com/Netflix/RxJava
  instruction ‘Import-Package’, ‘!org.junit,!junit.framework,!org.mockito.,
  instruction ‘Fragment-Host’, ‘com.netflix.rxjava.core’
  }
}


the plugin dependency is declared on gradle/buildscript.gradle

// Executed in context of buildscript repositories {   // Repo in addition to maven central   repositories { maven { url 'http://dl.bintray.com/content/netflixoss/external-gradle-plugins/' } } // For gradle-release } dependencies {   classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.1'   classpath 'com.mapvine:gradle-cobertura-plugin:0.1'   classpath 'gradle-release:gradle-release:1.1.5'   classpath 'org.ajoberstar:gradle-git:0.5.0'   classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.6.+' }

To reproduce this problem you could clone my github repository at https://github.com/MarioAriasC/RxJava/tree/develop

then checkout develop branch

git co develop

Any advice?

In case anyone wonders, I believe I solved the issue here: https://github.com/Ladicek/RxJava/commit/15f4cd70bc2a4889abc58913d6d99d8ae62d4f8c I have no idea why this works, though :-) The only difference is that the buildscript dependency on kotlin-gradle-plugin is declared in the submodule.

Hello Mario,

I’m investigating the plugin and it’s dependencies. Will post as soon as I have some info or fixes.

Cool, thanks

Ladislav’s solutions work for now

Sorry it took so long.

Indeed this is a real issue in Kotlin plugin for Gradle. I have created the issue in our tracker: http://youtrack.jetbrains.com/issue/KT-4168 please, vote