Skip to content
Advertisement

buildSrc: Could not get unknown property for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

I am trying to reorganize this Android (Java based) library to use the buildSrc folder to define all versions and dependencies as described in this article.

I already set this successfully up for several times for Kotlin bases projects. This time the project is pure Java.

In the buildSrc folder I created the following buildSrc/src/main/java/org/ligi/snackengage/Dependencies.java file:

JavaScript

Then I refer to the definitions in the project root build.gradle among others:

JavaScript

Here is the work in progress branch. When I build the project then the following error occurs:

JavaScript

Here is the build log.

Advertisement

Answer

You have defined GradlePlugins class as an inner static class of Dependencies, so you need to use Dependencies.GradlePlugins to access it from your build script.

Change your dependencies block as follows:

JavaScript

EDIT you could also use a static import, as follows:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement