Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle: 'compile' cannot be applied

Today I started a new JDK 11 project with Gradle 5.0 (using the Gradle Wrapper) and created a basic build script:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0'
    }
}

plugins {
    id 'java'
}

apply plugin: 'com.google.osdetector'

ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os

version = '0.1.0'

repositories {
    mavenCentral()
}

dependencies {
    compile "org.openjfx:javafx-graphics:11:$platform"
}

This - rather basic - build script results in the error

'compile' in 'org.gradle.api.artifacts.dsl.DependencyHandler' cannot be applied to '(groovy.lang.GString)'

enter image description here

Is that a JDK 11, a Gradle 5.0 or a user error? I've never seen that before.

like image 659
Hannes Avatar asked Mar 05 '23 23:03

Hannes


1 Answers

According to JetBrains support this is a known bug and will be fixed in 2018.3.1.

See: https://youtrack.jetbrains.com/issue/IDEA-203393

like image 192
Hannes Avatar answered Mar 10 '23 09:03

Hannes