https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
gradle
  • r

    Rodrigo Silva

    06/07/2022, 2:37 PM
    Hi all I'm using Gradle version 7.4.2, with kotlin dsl, and getting the following message "Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined..." I tried to add
    buildScan {
      termsOfServiceUrl = '<https://gradle.com/terms-of-service>'
      termsOfServiceAgree = 'yes'
    }
    but I always get error
    v
    n
    n
    • 4
    • 8
  • d

    David Smith

    06/08/2022, 1:59 PM
    Can anyone tell me how I can run a kotlin script from a custom gradle task? My project uses the kotlin DSL
    t
    • 2
    • 3
  • n

    nuhkoca

    06/08/2022, 2:49 PM
    Hey everyone! How can I access the instance of project in
    settings.gradle.kts
    ? I couldn’t find one(
    project
    ) of what I have in root
    build.gradle.kts
    ✅ 1
    t
    v
    a
    • 4
    • 18
  • m

    Marc

    06/09/2022, 5:02 PM
    hello! I added this into my gradle:
    withType<KotlinCompile>().configureEach {
            kotlinOptions {
                jvmTarget = "1.8"
                freeCompilerArgs = listOf("-Xcontext-receivers")
            }
        }
    But when I try to use
    context
    into a function it looks not detecting it. (I just created a simple JVM project) does anyone have idea what could happen?
    t
    v
    • 3
    • 47
  • l

    Lev Sorvin

    06/12/2022, 6:44 PM
    Hello. What could this error possibly mean? Is there any way to debug errors of this kind?
    n
    v
    e
    • 4
    • 12
  • m

    Michal Klimczak

    06/13/2022, 12:06 PM
    Depending on the JDK used, in kmm either
    iosX64Test
    or
    iosSimulatorArm64Test
    works and the other is
    SKIPPED
    . Can I check if the currently used JDK is
    arm64
    or
    x64
    compatible in gradle script to run the right test task?
    e
    • 2
    • 9
  • b

    Big Chungus

    06/13/2022, 3:18 PM
    So how are folks dealing with this when applying MPP + Android Lib plugins combo?
    The following Kotlin source sets were configured but not added to any Kotlin compilation:
     * androidAndroidTestRelease
     * androidTestFixtures
     * androidTestFixturesDebug
     * androidTestFixturesRelease
    You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
    a
    m
    t
    • 4
    • 10
  • m

    Mateusz Apacki

    06/15/2022, 7:57 AM
    Hi. What is the best way to unit test Custom Task (buildSrc)?. Extract logic to separate class, or what?
    v
    c
    • 3
    • 4
  • r

    ribesg

    06/15/2022, 1:57 PM
    Updated from Kotlin 1.6.21 to 1.7.0, I get this
    > Task :buildSrc:compileKotlin
    'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
    e: /Users/ribesg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.7.0/4d09852239f61842072b40b524882fa3caaed371/kotlin-compiler-embeddable-1.7.0.jar!/META-INF/backend-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
    e: /Users/ribesg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.7.0/4d09852239f61842072b40b524882fa3caaed371/kotlin-compiler-embeddable-1.7.0.jar!/META-INF/backend.common.jvm.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
    …
    Dependencies of my buildSrc subproject:
    dependencies {
        compileOnly(gradleKotlinDsl())
        implementation("com.android.tools.build:gradle:$androidGradleVersion")
        implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion")
    }
    What is happening?
    e
    n
    • 3
    • 11
  • p

    phil-t

    06/16/2022, 1:12 PM
    Hi, I’d like to know if it’s possible to set up a Gradle dependency to a project on my local machine, because I’m working on a something that requires changes to both projects. For this example let’s say
    my-project
    has a dependency on
    my-library
    which is set up in the build.gradle.kts of
    my-project
    like this:
    dependencies {
        implementation("com.example:my-library:1.16")
    }
    I don’t want to have to build/deploy
    my-library
    every time I change something, so is there a way to point the Gradle dependency to the local copy of
    my-library
    during development to make this easier? These projects are both under the same folder so I tried
    implementation("../my-library")
    but that didn’t work. I’m on a Mac using IntelliJ, not sure if that matters.
    :not-kotlin: 1
    r
    s
    +2
    • 5
    • 6
  • n

    nuhkoca

    06/18/2022, 8:23 PM
    maven("<https://path/to/dependencies>") {
        name = "fooBar"
        credentials(PasswordCredentials::class)
    }
    Hello I have a password protected remote packages and trying to use
    PasswordCredentials
    but I only have a
    password
    not
    username
    . How do I leave
    username
    empty and just inject password from
    gradle.properties
    ?
    v
    a
    g
    • 4
    • 8
  • w

    WukongRework.exe

    06/19/2022, 4:58 AM
    Hello everyone, I was trying to update my gradle (groovy) project to kotlin 1.7.0 and ran into a strange problem that I cannot seem to find on google. Error log and
    build.gradle
    in attached thread. Any help would be appreciated! Thanks in advance
    t
    • 2
    • 7
  • g

    Guilherme Delgado

    06/20/2022, 2:10 PM
    I want to create a custom plugin as follow:
    class KotlinJvmOptionsPlugin : Plugin<Project> {
        override fun apply(target: Project) {
            with(target) {
                extensions.configure<KotlinJvmOptions> {
                    jvmTarget = "11"
                    freeCompilerArgs = freeCompilerArgs + listOf("-Xopt-in=kotlin.RequiresOptIn")
                }
            }
        }
    }
    but it will fail with:
    Caused by: org.gradle.api.UnknownDomainObjectException: Extension of type 'KotlinJvmOptions' does not exist. Currently registered extension types: [ExtraPropertiesExtension, BasePluginExtension, DefaultArtifactPublicationSet, SourceSetContainer, ReportingExtension, JavaPluginExtension, JavaToolchainService, NamedDomainObjectContainer<BaseVariantOutput>, LibraryExtension, LibraryAndroidComponentsExtension]
    How can I solve this and have access to
    kotlinOptions
    ? Thanks 🙂
    h
    v
    • 3
    • 10
  • t

    Travis Reitter

    06/20/2022, 6:47 PM
    after upgrading from Kotlin 1.6.10 to 1.6.20, I'm suddenly hitting this error in my KMM project. Any idea why? Upgrading to 1.6.21 or 1.7.0 doesn't help:
    Task 'runCommonizer' not found in project ':android'
    p
    t
    s
    • 4
    • 19
  • g

    Guilherme Delgado

    06/21/2022, 3:15 PM
    I’m in the process of migrating from buildSrc to build-logic, and I was studying idiomatic-gradle and also Google’s now-in-android repository. But I’m having a problem, in buildSrc I’ve classes and enums that can be accessed by any module’s
    build.gradle.kts
    , but when using build-logic, I can’t share them, it throws
    org.gradle.internal.exceptions.LocationAwareException
    . Surely I’m doing something wrong because Google’s sample uses it with no problem here, but I don’t know what’s missing 😞 Any hint? Thanks 🙏
    c
    v
    n
    • 4
    • 19
  • t

    tapchicoma

    06/21/2022, 4:53 PM
    More in-depth post about build reports feature introduced in Kotlin 1.7.0: https://blog.jetbrains.com/kotlin/2022/06/introducing-kotlin-build-reports/
    👍🏾 1
    👍 5
  • s

    Slackbot

    06/22/2022, 4:12 PM
    This message was deleted.
    t
    u
    • 3
    • 3
  • c

    Chachako

    06/23/2022, 9:33 AM
    Hello, everyone. I wonder if there is any way to observe the completion of
    DomainObjectCollection
    ? Is this Kotlin code correct?
    val dependencies = channelFlow {
      project.configurations.configureEach {
        it.dependencies.forEach(::trySend)
      }
    }
    
    // On "configureEach" completion
    println(dependencies)
    s
    v
    • 3
    • 12
  • g

    Guilherme Delgado

    06/24/2022, 11:50 AM
    Hello guys, I’ve finished my buildSrc to build-logic + versions catalog migration, but I’ve a little problem 😒, more in thread.
    j
    • 2
    • 35
  • n

    nuhkoca

    06/25/2022, 1:39 PM
    Hello, I have a
    jacocoTestReport
    task that depends on
    testDebugUnitTest
    and it was just generating
    debug
    related reports and exec files but since the last week
    jacocoTestReport
    both executes
    debug
    ,
    internal
    and
    release
    tasks and generates reports. This has drastically increased CI time. I never touched configuration or so. What could be the root cause to this misconduct?
    • 1
    • 5
  • y

    Yashar

    06/28/2022, 2:35 PM
    Does anyone know how I can pickup
    implementation project(":foo:bar")
    from the gradle
    ConfigurationContainer
    ? Basically what I am trying to do is swap out project dependency to maven dependency during publishing so those dependencies can be included within the AAR’s POM file.
  • n

    nuhkoca

    06/28/2022, 8:59 PM
    Hello, I have set up
    build-logic
    instead of
    buildSrc
    and moved some code in there. However, I am getting an exception when I try to use something from
    build-logic
    fun VariantDimension.stringField(name: String, value: String) {
        buildConfigField("String", name, "\"$value\"")
    }
    ScriptCompilationException(errors=[ScriptCompilationError(message=Unresolved reference: stringField, location=/Users/nuhkoca/.gradle/.tmp/gradle-kotlin-dsl-16705359721542638789.tmp/build.gradle.kts (27:9))
    m
    • 2
    • 3
  • e

    Emil Kantis

    06/29/2022, 10:30 PM
    How do you configure Kotlin JVM target/source compatability when using the multiplatform plugin?
    t
    a
    • 3
    • 24
  • m

    mikehearn

    06/30/2022, 12:52 PM
    I feel like this is a basic question but I can't find it answered in any documentation. I followed the standard Gradle template to create a Kotlin project, the one that creates three custom plugins (common conventions, etc). It doesn't mention how to change/upgrade the Kotlin version anywhere. It's this one: https://docs.gradle.org/current/samples/sample_building_kotlin_applications_multi_project.html None of the generated files actually specify the Kotlin version, and trying to add such a version just creates a mountain of inexplicable errors. What's the trick?
    k
    j
    +5
    • 8
    • 75
  • h

    Harold Martin

    06/30/2022, 8:59 PM
    Hello! I have a subproject
    uistuff
    which my subproject
    app
    depends on.
    uistuff
    retrieves
    implementation
    dependencies from a private repository only specified in its build.gradle . However
    app
    seems to believe it should have these dependencies (but can’t find them due to not having the private repository configured). Strangely, when looking at a build scan
    uistuff
    does not appears in the dependencies pane unlike all of my other subprojects. Any ideas what might cause this?
    m
    • 2
    • 4
  • l

    Lukasz Kalnik

    07/01/2022, 8:58 AM
    I have a custom Gradle plugin which adds different common dependencies. However I cannot find the syntax for adding a dependency on another project. In Kotlin Gradle Script DSL the syntax would be:
    testImplementation(project(":myProject"))
    I need the syntax for writing a Kotlin plugin:
    project.dependencies.add("testImplementation", /* How do I create a project dependency notation here? */)
    j
    v
    j
    • 4
    • 72
  • l

    Lukasz Kalnik

    07/01/2022, 9:01 AM
    All examples in the API documentation seem to be in Groovy Script DSL. Is there a documentation anywhere on how to use the Gradle Java API directly (when writing plugins in Java/Kotlin) to achieve the same results?
  • s

    Sam

    07/01/2022, 10:49 AM
    Good afternoon. Please help me find a solution. I have an android project and I want to move a section from the module level gradle to the project level. I am using Kotlin DSL. I found a solution for Groovy but I can't migrate it to Kotlin.
    def applyAndroid(project) {
        project.android {
    
            compileSdkVersion compileVersion
    
            defaultConfig {
                minSdkVersion minVersion
                targetSdkVersion compileVersion
                versionCode verCode
                versionName verName
                testInstrumentationRunner testRunner
            }
    
            compileOptions {
                sourceCompatibility = 1.8
                targetCompatibility = 1.8
            }
    
            kotlinOptions {
                jvmTarget = "1.8"
    //            useIR = true
                freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
                freeCompilerArgs += "-Xjvm-default=all"
            }
    
            testOptions.unitTests {
                includeAndroidResources = true
            }
    
            buildFeatures {
                aidl = false
                renderScript = false
                resValues = false
                shaders = false
            }
        }
    
    }
    I have a limitation in the Project class, I can't find an android() method
    v
    • 2
    • 5
  • c

    CRamsan

    07/05/2022, 2:46 PM
    Hello everyone. Does anyone know if there is any issues or changes to the Kotlin plugin with Kotlin 1.7? When I set my kotlin version to 1.7, several of my projects fail to configure. A common failure is this:
    Build file 'C:\Users\cesar\git\CoreProject\auraxiscontrolcenter\db-models\build.gradle' line: 13
    
    * What went wrong:
    A problem occurred evaluating project ':project'.
    > No signature of method: build_b51p5sfw7s50l52yfyob77d9q.kotlin() is applicable for argument types: (build_b51p5sfw
      Possible solutions: notify(), toString(), toString(), toString(), toString(), split(groovy.lang.Closure)
    This error refers to the
    apply plugin: "org.jetbrains.kotlin.multiplatform"
    
    kotlin { <---- this is line 13
       ......
    }
    Going through the documentation for Gradle and the Kotlin plugins did not yield any results. I am not sure why this is breaking in 1.7.
    t
    • 2
    • 4
  • n

    Norbi

    07/06/2022, 8:48 AM
    I try to upgrade my project to Kotlin 1.7.0 and I get this error:
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    wasm
    Any ideas what should I change? Thanks. Env: Kotlin 1.7.0, Gradle 7.4.2, Compose/MP 1.2.0-alpha01-dev741
    s
    • 2
    • 4
Powered by Linen
Title
n

Norbi

07/06/2022, 8:48 AM
I try to upgrade my project to Kotlin 1.7.0 and I get this error:
FAILURE: Build failed with an exception.

* What went wrong:
wasm
Any ideas what should I change? Thanks. Env: Kotlin 1.7.0, Gradle 7.4.2, Compose/MP 1.2.0-alpha01-dev741
s

Sam

07/06/2022, 8:48 AM
Can you run the build again with
--stacktrace
?
n

Norbi

07/06/2022, 9:10 AM
Hm, now I get a different error:
* Exception is:
java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetPreset$WhenMappings
	at org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetPreset.getName(KotlinJsIrTargetPreset.kt:90)
	at org.gradle.api.internal.DynamicPropertyNamer.determineName(DynamicPropertyNamer.java:32)
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:111)
	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:251)
	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.setupDefaultPresets(KotlinMultiplatformPlugin.kt:198)
	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.apply(KotlinMultiplatformPlugin.kt:106)
	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.apply(KotlinMultiplatformPlugin.kt:51)
	at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:179)
	at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:134)
	at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
	at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
	at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:187)
	at org.gradle.api.internal.plugins.DefaultPluginManager.access$100(DefaultPluginManager.java:52)
	at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:282)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.plugins.DefaultPluginManager.lambda$doApply$0(DefaultPluginManager.java:167)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
	at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:166)
	at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:137)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugin$1(DefaultPluginRequestApplicator.java:149)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:201)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:147)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$200(DefaultPluginRequestApplicator.java:61)
...
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
I had to change one of the build files to get the original error again:
* Exception is:
java.lang.NoSuchFieldError: wasm
	at org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetPreset$WhenMappings.<clinit>(KotlinJsIrTargetPreset.kt)
	at org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetPreset.getName(KotlinJsIrTargetPreset.kt:90)
	at org.gradle.api.internal.DynamicPropertyNamer.determineName(DynamicPropertyNamer.java:32)
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:111)
	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:251)
	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.setupDefaultPresets(KotlinMultiplatformPlugin.kt:198)
	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.apply(KotlinMultiplatformPlugin.kt:106)
	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.apply(KotlinMultiplatformPlugin.kt:51)
	at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:179)
	at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:134)
	at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
	at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
	at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:187)
	at org.gradle.api.internal.plugins.DefaultPluginManager.access$100(DefaultPluginManager.java:52)
	at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:282)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.plugins.DefaultPluginManager.lambda$doApply$0(DefaultPluginManager.java:167)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
	at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:166)
	at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:137)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugin$1(DefaultPluginRequestApplicator.java:149)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:201)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:147)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$200(DefaultPluginRequestApplicator.java:61)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1$1.lambda$add$1(DefaultPluginRequestApplicator.java:120)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyPlugins$0(DefaultPluginRequestApplicator.java:143)
	at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:143)
	at org.gradle.kotlin.dsl.provider.PluginRequestsHandler.handle(PluginRequestsHandler.kt:48)
	at org.gradle.kotlin.dsl.provider.StandardKotlinScriptEvaluator$InterpreterHost.applyPluginsTo(KotlinScriptEvaluator.kt:195)
	at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.applyPluginsTo(Interpreter.kt:398)
	at Program.execute(Unknown Source)
	at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.eval(Interpreter.kt:532)
	at org.gradle.kotlin.dsl.execution.Interpreter.eval(Interpreter.kt:205)
	at org.gradle.kotlin.dsl.provider.StandardKotlinScriptEvaluator.evaluate(KotlinScriptEvaluator.kt:115)
	at org.gradle.kotlin.dsl.provider.KotlinScriptPluginFactory$create$1.invoke(KotlinScriptPluginFactory.kt:51)
	at org.gradle.kotlin.dsl.provider.KotlinScriptPluginFactory$create$1.invoke(KotlinScriptPluginFactory.kt:36)
	at org.gradle.kotlin.dsl.provider.KotlinScriptPlugin.apply(KotlinScriptPlugin.kt:34)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
Hmmm, something solved it 😐 What I did: • removed the JS targets (they were only experimental in my project, Kotlin/JS seems to be full of problems currently anyway) • removed the
buildSrc
project To tell the truth, Kotlin tooling is full of problems, I often run into strange problems 😞 I wish it would stabilize in the near future, so I could focus on my app instead of fighting the build system...
View count: 13