reckon: NPE: Must provide a scope supplier
Hello and thanks for reckon. Been using it for a while and it really really helps managing versions.
On some project, I’m trying to upgrade kotlin JVM plugin from 1.3.72 to 1.4.10 and get the following error:
* What went wrong:
Failed to apply plugin [id 'org.jetbrains.kotlin.jvm']
> Must provide a scope supplier.
I probably did something wrong, but everything was working completely fine with 1.3.72, any idea?
Thanks a lot.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 19 (5 by maintainers)
@aesteve I had the same issue in a multi-project build. For me, the issue was that the
subprojects
block was located (ongradle.build
), before thereckon {}
block, and apparently the kotlin plugin now needs access toproject.version
, before reckon is ready to provide it. This seem to match the situation on this testI was able to fix it just by moving the reckon configuration block right below the
plugins {}
block, beforesubprojects
Hey @aesteve I solved the problem by reordering the plugins:
More specifically I put the reckon plugin after kotlin plugins.
Re: @x80486 in #170 (which is a duplicate of this discussion)
I have a handful of thoughts around this:
Plugin<Settings>
, which aren’t common and I’ve not used before, but should be early enough to stop any normalPlugin<Project>
from interfering. It would also reinforce the idea that reckon is setting a build-wide version not a project-specific version.version.toString()
before thereckon {}
has run its going to get the wrong version regardless, because it’s probably running before the user had a change to writeversion = 'whatever'
if they weren’t using reckon. Maybe that caller doesn’t need the version for an important purpose or maybe the plugin or you will go correct it later anyway. However, that’s utlimately a problem with the other plugin, and not something reckon really needs to play traffic cop on. The logging should help trace down the offending plugin in case tweaks need to be made there.project.getVersion()
explicit by usingProperty<String>
. They have issues open for this in gradle/gradle#13672 and gradle/gradle#15088. Even if they fix this, it will take time for plugins to be updated to use the new method. Since plugins could address this currently anyway, it doesn’t replace the need for 1 or 2.project.getVersion()
and likely make changes to access it more lazily. Again 3 would help them with this, but its not necessary technically.I’m currently working on updates to other plugins, so this isn’t the top of my list, but I do plan to come back to this. And I think both 1 and 2 are approaches I want to pursue.
The general problem here is likely other plugins that are too eagerly trying to get the version from
project.getVersion().toString()
. Reckon’s approach is only quasi-supported by Gradle by them declaring the type ofproject.getVersion()
asObject
instead ofString
. Nowadays it should really be aProvider<String>
which would work better with how Reckon wants to behave.I’m not sure if it’s resolvable by Reckon, since it almost looks like a plugin trying to access the version before the
reckon {}
extension block runs, which really seems like a bug in another plugin. I could be misinterpreting here though.I would be curious if 0.14.0 works any better for those of you with this issue. The fundamental approach is unchanged, but it more deeply uses
BuildService
andProperty
/Provider
that before.Hmm, maybe #170 is duplicate but it only started happening for me after a Gradle 7.4 upgrade, with
jacoco
.I have no idea how determinate it is in Gradle; but just changing the order in the
plugins
block seemed enough to go from working to broken. 😬I have the same issue here but with a normal java project. This is with a project using the java-test-fixtures plugin.
I am experiencing the same issue! I am using (among others) these plugins:
When I switch to version 1.4.0 upon reimport of gradle projects I get this weird exception
When I try to gradle clean or build I get the already mentioned exception:
Could you guys have a look? We would like to use some features of 1.4.0.
Relevant (maybe) info: