You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
problems loading ktlint/ktfmt when using buildsrc #740
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Cannot resolve external dependency com.facebook:ktfmt:0.16 because no repositories are defined.
Required by:
project :
You probably need to add a repository containing the '[com.facebook:ktfmt:0.16]' artifact in the 'build.gradle' of your root project.
E.g.: 'buildscript { repositories { mavenCentral() }}'
tried this in my buildSrc/build.gradle.kts
repositories {
gradlePluginPortal()
mavenCentral()// so that external plugins can be resolved in dependencies section
}
dependencies {
implementation("com.facebook:ktfmt:0.16")
and the suggested buildscript
> Failed to apply plugin 'ppm.java-convention'.
> The `buildscript` block is not supported on Kotlin script plugins, please use the `plugins` block or project level dependencies.
I know that settings.gradlepluginManagement { repositories { thing is a relatively new thing. Dunno when/if the old buildscript { repositories { thing was removed.
Would be great for this error message to be gradle-version-dependent, PR's wanted.
I know that settings.gradlepluginManagement { repositories { thing is a relatively new thing. Dunno when/if the old buildscript { repositories { thing was removed.
Would be great for this error message to be gradle-version-dependent, PR's wanted.
so thinks,this code successfully solved my problem,but my problem is
The buildscript block is not supported on Kotlin script plugins, please use the plugins block or project level dependencies.
my environment is gradle 6.7.1 kotlin 1.5.31 gradle plugin 4.2.2
Activity
nedtwigg commentedon Nov 18, 2020
It will need to be in
/build.gradle.kts, not inbuildSrc/build.gradle.kts.If you can't add it there, the other place you can add it is in
settings.gradle:I know that
settings.gradlepluginManagement { repositories {thing is a relatively new thing. Dunno when/if the oldbuildscript { repositories {thing was removed.Would be great for this error message to be gradle-version-dependent, PR's wanted.
nedtwigg commentedon Jan 4, 2021
Closing due to inactivity, happy to discuss further if new info arises.
wsdydeni commentedon Nov 5, 2021
so thinks,this code successfully solved my problem,but my problem is
my environment is gradle 6.7.1 kotlin 1.5.31 gradle plugin 4.2.2
nedtwigg commentedon Nov 5, 2021
I would watch #941 for a resolution to this in the future.