task test {
println project.hasProperty(‘foo’);
println foo;
}
works
I wasn’t able to get Project.findProperty() to work. It always returns the following error:
No signature of method: static org.gradle.api.Project.findProperty() is applicable for argument logic: (java.lang.String) value: [project.foo]
Possible solution: hsaProperty(java.lang.String)
How does findProperty work? Seems like Project.findProperty(‘foo’) should work.
I upgraded to Java 8 and this resolved the problem. So, given that Gradle requires JVM 7 or higher this appears to be a bug at least in the documentation.
No signature of method: static org.gradle.api.Project.findProperty() is applicable for argument logic: (java.lang.String) value: [project.foo]
Possible solution: hsaProperty(java.lang.String)
The fact that you get an error about not being able to locate a static method leads me to believe that you have a capitalized project reference somewhere, however it makes no sense that it would work in Java 8 and not 7.
The only way I’ve been able to reproduce a similar error as you is if I try calling Project.findProperty() instead of project.findProperty(), which results in:
> No signature of method: static org.gradle.api.Project.findProperty() is applicable for argument types: (java.lang.String) values: [foo]
Possible solutions: hasProperty(java.lang.String)
Also note that your error message says that the argument value is ‘project.foo’, perhaps that helps you narrow this down. Also, does the stack trace generated when running gradle with -s help locate the point of failure?