Fix compile error in build.gradle.kts on Gradle 7.6
See original GitHub issueThe 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:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!)
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. 👍🏾