question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix compile error in build.gradle.kts on Gradle 7.6

See original GitHub issue

The build file (build.gradle.kts) does not compile on Gradle 7.6-rc-3:

  Line 300: implementation(project)
	^ None of the following functions can be called with the arguments supplied: 
	    public operator fun DependencyAdder.invoke(dependencyNotation: CharSequence): Unit defined in org.gradle.kotlin.dsl
	    public operator fun DependencyAdder.invoke(dependency: Dependency): Unit defined in org.gradle.kotlin.dsl
	    public operator fun DependencyAdder.invoke(files: FileCollection): Unit defined in org.gradle.kotlin.dsl
	    public operator fun DependencyAdder.invoke(dependency: Provider<out Dependency>): Unit defined in org.gradle.kotlin.dsl
	    public operator fun DependencyAdder.invoke(externalModule: ProviderConvertible<out MinimalExternalModuleDependency>): Unit defined in org.gradle.kotlin.dsl

1 error

See, e.g., this build.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
carterkozakcommented, Nov 14, 2022

I’ve pushed #687 which provides more standard syntax (with the caveat that I don’t have experience with Kotlin, but it’s what I’d do in groovy!)

0reactions
nipafxcommented, Nov 15, 2022

Thank you @carterkozak! 🙏🏾 I just pulled main to apply your proposal as given on Mastodon and was surprised to already see it in action. Very cool!

@jvandort That looks like the cleaner syntax but it only works on Gradle 7.6, not on 7.5 yet and we need to build on both. (Because the “real” builds run with 7.5 and experimental ones with 7.6 to preview problems like these.) We can switch to the cleaner project() as soon as we rely on 7.6. 👍🏾

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntelliJ build.gradle.kts indicates errors but runs fine.
Intellij shows errors in the build.gradle.kts and the settings.gradle.kts file: However, gradlew build runs without errors/exceptions.
Read more >
Upgrading your build from Gradle 6.x to the latest
To fix this error, create a settings.gradle(.kts) file for the build. Exceptions to this are invoking Gradle with the init task or using...
Read more >
Gradle 7.6 Release Notes
The Gradle team is excited to announce Gradle 7.6. This release includes building and running code with Java 19, a flag to rerun...
Read more >
Gradle Kotlin DSL Primer
We recommend that you disable automatic build import, but enable automatic reloading of script dependencies. That way you get early feedback while editing ......
Read more >
userguide.pdf - Gradle User Manual
Any supported version of Java can be used for compile or test. For older Gradle ... To fix this error, create a settings.gradle(.kts)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found