gmazzo / gradle-buildconfig-plugin

A plugin for generating BuildConstants for any kind of Gradle projects: Java, Kotlin, Groovy, etc. Designed for KTS scripts.
MIT License
653 stars 29 forks source link

failed to download #137

Closed Pirmuhammad9 closed 7 months ago

Pirmuhammad9 commented 7 months ago

Hi, i faced this "unable to find method ''java.io.File com.squareup.kotlinpoet.FileSpec.writeTo(java.io.File)'' 'java.io.File com.squareup.kotlinpoet.FileSpec.writeTo(java.io.File)'" issues, Is there any solution

gmazzo commented 7 months ago

Is possibly a duplicated of #125? This is usually caused by another plugin added in a high order classloader (root project or buildSrc) that has KotlinPoet dependency outdated

Pirmuhammad9 commented 7 months ago

do you know any plugins that may cause it

gmazzo commented 7 months ago

Nope, but you should be able to figure out by inspecting the build dependencies with a Gradle scan

gmazzo commented 7 months ago

I'm closing it because the same reason than #125. This is not actually an issue with this plugin, but a configuration clash with another one

gmazzo commented 7 months ago

Is possibly a duplicated of https://github.com/gmazzo/gradle-buildconfig-plugin/issues/125?

By the way @Pirmuhammad9 , I meant #131, check if its workaround works for you. It should

buildscript {
  dependencies {
    // Yuck. Need to force kotlinpoet:1.16.0 as that is what buildconfig uses.
    // CMP 1.6.0-x uses kotlinpoet:1.14.x. Gradle seems to force 1.14.x which then breaks
    // buildconfig.
    classpath("com.squareup:kotlinpoet:1.16.0")
  }
}