Upgrade from 3.2.1 to 3.3 and now get an odd Gradle Error


(Gil C) #1

No signature of method: org.gradle.util.Path.plus() is applicable for argument types: (java.lang.String) values: [/docs/]
Possible solutions: path(java.lang.String), is(java.lang.Object), split(groovy.lang.Closure), use([Ljava.lang.Object;), wait(), dump()

Line from build.gradle
projectPath = project.projectDir.toString()

Line in my subproject build.gradle
def locateDocshome= projectPath + ‘/docs/’


(Benjamin Muschko) #2

I can’t reproduce the issue. I already get an error on the first line:

Cannot set the value of read-only property ‘projectPath’ for root project ‘path’ of type org.gradle.api.Project.

Why do you want to change the property?


(Gil C) #3

Here is some more information and how I duplicated it in a much smaller build.gradle

  1. create a folder
  2. create build.gradle using below content minus the start/end lines
  3. create a wrapper with 3.2.1 bin version
  4. gradle wrapper
  5. ./gradlew tasks
  6. this should work just fine
  7. change to 3.3 by modifying the gradle/wrapper/gradle-wrapper.properties change 3.2.1 to 3.3
  8. ./gradlew wrapper
  9. Failure occurs on line 7
    No signature of method: org.gradle.util.Path.plus() is applicable for argument types: (java.lang.String) values: [/docs/]
    Possible solutions: path(java.lang.String), use([Ljava.lang.Object;), is(java.lang.Object), split(groovy.lang.Closure), wait(), grep()

//****** START of build.gradle *************
apply plugin: ‘java’

ext {
projectPath = project.projectDir.toString()
}

def locateDocshome= projectPath + ‘/docs/’
//****** END of build.gradle *************


(Benjamin Muschko) #4

You can read about it here: https://github.com/gradle/gradle/issues/1072.


(Gil C) #5

I’ve read that but I’m not sure I’m getting what I have to do in order to fix this and use 3.3

Do I need to change from the variable name of projectPath to something else?

Thank you for your help.


(Benjamin Muschko) #6

Yes, just change the variable name you are defining.