https://kotlinlang.org logo
Join Slack
Powered by
# build-tools
  • e

    Eugen Martynov

    01/09/2023, 1:16 PM
    Does kotlin 1.8.0 strip in the bytecode parameter names in public functions? When IDE decompiles artifact built with Kotlin 1.8.0 I see
    Copy code
    @Nullable
     Object createConversation(int var1, @NotNull String var2, @Nullable String var3, boolean var4, @Nullable String var5, @NotNull Continuation<? super CreateConversationResult> var6);
    
     @Nullable
     Object retrySdkSessionInit(@NotNull Continuation<? super Unit> var1);
    Or could it be R8? (this is an Android library).
    e
    • 2
    • 4
  • l

    Lucy

    01/16/2023, 7:05 PM
    Hello, 🙂 has anyone noticed differences with minification and Kotlin 1.8.0 (kotlin-gradle-plugin)? I'm building an Android library with minified enabled and the resulting class files are completely different from Kotlin 1.7.2. Example using 1.7.2 and minify
    Copy code
    public final class Test public constructor() {
        public final fun addOne(num: <http://kotlin.Int|kotlin.Int>): <http://kotlin.Int|kotlin.Int> { /* compiled code */ }
    
        public final suspend fun suspendAddOne(num: <http://kotlin.Int|kotlin.Int>): <http://kotlin.Int|kotlin.Int> { /* compiled code */ }
    }
    Same code after using 1.8.0 and minify
    Copy code
    public final class Test {
        public static final int $stable;
    
        public Test() {
        }
    
        public final Object suspendAddOne(int var1, Continuation<? super Integer> var2) {
            return Boxing.boxInt(var1 + 1);
        }
    
        public final int addOne(int var1) {
            return var1 + 2;
        }
    }
    In 1.8.0, I am also getting an extra parameter variable with suspend functions. I can't find any documentation or logs about this change (looked at kotlin, gradle, and minify/R8 release pages). If anyone could point me in the right direction it would be greatly appreciated!
    e
    • 2
    • 5
  • j

    jean

    02/07/2023, 8:16 AM
    I have a multiplatform library project that uses ksp to generate some code. When I try to publish that library to a maven repo I get
    Unresolved reference
    wherever the library is referencing a generated class/function. What am I suppose to do to tell the publish gradle task to also publish the generated code?
    t
    • 2
    • 2
  • d

    David Kubecka

    04/13/2023, 10:31 AM
    A
    kotlin-maven-plugin
    question: I'm using that plugin to run a (java) annotation processor. That processor uses
    Diagnostic.Kind.NOTE
    for diagnostic messages. These show up as ERROR in the plugin output, whereas the equivalent java plugin shows them as INFO. Is this expected?
    t
    • 2
    • 1
  • d

    Daniele Segato

    06/06/2023, 7:09 AM
    Does anyone know what this error means?
    Copy code
    java.lang.IllegalArgumentException: com.intellij.openapi.externalSystem.model.project.dependencies.DependencyScopeNode is not an interface
    	at java.base/java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Unknown Source)
    	at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Unknown Source)
    	at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Unknown Source)
    	at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Unknown Source)
    	at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(Unknown Source)
    	at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(Unknown Source)
    	at java.base/java.lang.reflect.Proxy.getProxyConstructor(Unknown Source)
    	at java.base/java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.createView(ProtocolToModelAdapter.java:160)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.convert(ProtocolToModelAdapter.java:276)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter.access$1500(ProtocolToModelAdapter.java:56)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$AdaptingMethodInvoker.invoke(ProtocolToModelAdapter.java:477)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$PropertyCachingMethodInvoker.invoke(ProtocolToModelAdapter.java:705)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SafeMethodInvoker.invoke(ProtocolToModelAdapter.java:742)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$SupportedPropertyInvoker.invoke(ProtocolToModelAdapter.java:766)
    	at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.invoke(ProtocolToModelAdapter.java:432)
    	at jdk.proxy6/jdk.proxy6.$Proxy166.getCompileDependenciesGraph(Unknown Source)
    	in ProjectDependenciesSerializationService$2.process(ProjectDependenciesSerializationService.java:90)
    The project get stuck at initial import when I open Android Studio, this started happening with AS Hedgehog Canary 6: worked in Canary 5. https://issuetracker.google.com/issues/285195965
    t
    d
    • 3
    • 11
  • d

    dave08

    06/19/2023, 11:33 AM
    Anyone know how to solve
    Cannot use @TaskAction annotation on method AbstractKotlinCompile.execute() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
    when upgrading from an older AGP version to 8.0.2?
    a
    • 2
    • 5
  • n

    Norbi

    09/05/2023, 12:41 PM
    I try to upgrade my project to Kotlin 1.9.10 + Compose Multiplatform 1.5.0. Until now I used this configuration to ignore Compose incompatibility checks (with Kotlin 1.8.21 and Compose Multiplatform 1.5.0-dev1084):
    Copy code
    compose {
        kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.8.20"))
        kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.8.21")
    }
    How should I modify the above configuration to prevent
    Copy code
    Compose Multiplatform 1.5.0 doesn't support Kotlin 1.9.10
    error? Thanks.
    t
    • 2
    • 4
  • c

    chi

    09/18/2023, 5:17 AM
    I’m trying to upgrade my project from
    kapt
    to
    ksp
    but I’m seeing the following error;
    Copy code
    Execution failed for task ':app:kspDebugKotlin'.
    > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
       > Compilation error. See log for more details
    Please any idea what could be the cause and how I can fix this?
    a
    • 2
    • 2
  • d

    d4span

    11/01/2023, 9:31 PM
    After I upgraded to Kotlin 1.9.20, my Maven build breaks with the following error:
    Copy code
    [INFO] --- kotlin:1.9.20:kapt (default-kapt) @ awesomeproject ---
    [ERROR] java.lang.IllegalAccessError: superclass access check failed: class org.jetbrains.kotlin.kapt3.base.javac.KaptJavaCompiler (in unnamed module @0x63300c4b) cannot access class com.sun.tools.javac.main.JavaCompiler (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.main to unnamed module @0x63300c4b
    	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
    	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
    	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
    	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
    	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
    	at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
    	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
    	at org.jetbrains.kotlin.kapt3.base.KaptContext.<init>(KaptContext.kt:55)
    With Kotlin 1.9.10, everything works as expected. Any ideas how I can fix this?
    t
    • 2
    • 3
  • c

    Christopher Hübner

    01/15/2024, 9:08 AM
    What book/course/documentation for getting deep dive in gradle, kotlin, testing and multi module pattern? 🙂
    m
    b
    e
    • 4
    • 6
  • v

    Vivek Rajendran

    02/21/2024, 6:01 AM
    Do we have any library similar to androidx.annotation.RestrictTo in kotlin? I am trying to create modular kmp sdk with limited api surface. I want some of the apis to be accessible in my other sdks but restrict them in public. For similar case, androidx has androidx.annotation.RestrictTo. Do we have anything similar in kotlin kmp world?
    t
    • 2
    • 2
  • d

    Dmytro Serdiuk

    02/26/2024, 12:34 AM
    Hello! I saw that to run kotlin compiler before java using maven we need to add:
    Copy code
    <executions>
    <!-- Replacing default-compile as it is treated specially by maven -->
    <execution> <id>default-compile</id> <phase>none</phase>
    </execution>
    <!-- Replacing default-testCompile as it is treated specially by maven --> <execution>
    <id>default-testCompile</id>
    <phase>none</phase>
    I know that default-goal is added as an ID by default, but why “default-compile” is called first even if the plugin defined the second inn the pom file? Thanks!
  • c

    cfleming

    04/09/2024, 6:39 AM
    Is there any way to get incremental Kotlin compilation using the CLI compiler?
    t
    • 2
    • 4
  • c

    czuckie

    04/15/2024, 11:08 AM
    Fwiw: I got an email asking me to take a survey from JB and it renders incorrectly on mobile and is unresponsive
    t
    m
    n
    • 4
    • 5
  • a

    Andy Hebert

    04/18/2024, 7:15 PM
    Has anyone had issues with a Kotlin JVM app when trying to use AppCDS. I am running into
    Copy code
    [5.016s][info   ][cds         ] Run GC done
    [5.016s][error  ][cds         ] Error: non-empty directory '/home/a/git/u/build/classes/kotlin/main'
    Hint: enable -Xlog:class+path=info to diagnose the failure
    Because Kotlin is putting a app-name.kotlin_module int the build/classes/kotlin/main/META-INF directory. Anyone have a way to work around this?
  • n

    Norbi

    08/16/2024, 1:55 PM
    I have realized that originally I posted to the wrong channel...
  • r

    robnik

    08/21/2024, 3:57 PM
    I tried upgrading Kotlin to 2.0.10 (from 1.something), and now our Maven builds are sporadically failing with this. Anyone know what this is?
    Copy code
    [INFO] --- kotlin-maven-plugin:2.0.10:compile (compile) @ omnisee ---
    [WARNING] Using experimental Kotlin incremental compilation
    [ERROR] Incremental compilation failed: java.lang.NegativeArraySizeException
    java.io.IOException: java.lang.NegativeArraySizeException
    	at com.intellij.util.io.IOUtil.readString(IOUtil.java:48)
    	at org.jetbrains.kotlin.incremental.storage.StringExternalizer.read(externalizers.kt:225)
    	at org.jetbrains.kotlin.incremental.storage.FileDescriptor.read(FileToPathConverter.kt:37)
    	at org.jetbrains.kotlin.incremental.storage.FileDescriptor.read(FileToPathConverter.kt:30)
    t
    • 2
    • 2
  • h

    Harish Reddy

    09/16/2024, 10:28 AM
    Hello folks! Hope you are all doing great! I am facing some issues with Publishing Android library setup. Any help/pointers would be greatly appreciated. I have a KMP project with multi-module setup. Module-1:
    CoreModule
    Module-2:
    FeatureModule
    FeatureModule
    references
    CoreModule
    internally using
    api(project(path = ":CoreModule))
    . The final artifact
    FeatureModule
    after publishing to maven/maven local is supposed to be integrated in main Android app. So, now my expectation is to have the code within
    CoreModule
    to be accessible inside the main Android app since
    FeatureModule
    includes the
    CoreModule
    . But, I can’t access the code/classes within
    CoreModule
    inside the main Android app. This is a KMP project which I am not so familiar with. So, not sure if it is a KMP thing or something else. Any idea what could be missing in this setup? I am attaching reference code in the thread.
    t
    • 2
    • 4
  • n

    Natalia Mishina

    10/09/2024, 9:16 AM
    Hey! Kotlin team is wondering if this feedback question would be clear to you. Could you help us by letting us know how you understand it? kodee pleased Imagine that, while working in IntelliJ IDEA, you see this feedback window pop up (see the picture attached). What do you think we're asking you to evaluate? Please vote by reacting to this post: 1️⃣ It’s about my experience with Gradle as a build tool. 2️⃣ It’s about my experience with Gradle in the context of Kotlin. 3️⃣ It’s about how Gradle integrates with the IDE. 4️⃣ It’s about my overall experience using Gradle. 5️⃣ It’s about my overall experience using Kotlin. 6️⃣ I’ll write my own interpretation in the thread. Thanks a lot for your help!
    2️⃣ 1
    3️⃣ 11
    4️⃣ 1
    5️⃣ 1
    6️⃣ 1
    1️⃣ 8
    m
    a
    c
    • 4
    • 4
  • j

    jw

    10/24/2024, 4:14 AM
    Hello! With Kotlin 2.0.20 deprecating support for Gradle's built-in 'application' plugin for packaging distributable JVM executable archives, can https://youtrack.jetbrains.com/issue/KT-41409 be reopened for a first-party KGP replacement?
    👌 6
    👌🏾 2
    ➕ 4
  • c

    Charlie Tapping

    01/20/2025, 6:15 PM
    Whats the chances we can get a linuxArm64Test task? Github now supports linux arm runners and I’d like to add a workflow to cover this platform
    j
    • 2
    • 4
  • c

    calidion

    02/02/2025, 2:08 PM
    seems I cannot download this package now.
    sad panda 1
  • j

    joseph_ivie

    02/20/2025, 5:39 AM
    I'm looking into putting together an alternative to Gradle and Amper for KMP projects, mostly as a hobby. I think I've figured out the majority of what I need by reading through Amper's source, but I'm lost on how these integrate into IntelliJ - I've seen how IntelliJ only JVM projects use
    .iml
    files to define the modules, but the Gradle integration does not appear to generate any of these files, yet somehow works. Is an IntelliJ plugin necessary to define the projects and modules? If so, can anyone get me a good starting point? My non-multiplatform version of this project just used those `.iml`s but that's not an option this time around.
    g
    t
    a
    • 4
    • 6
  • j

    jrod

    04/03/2025, 12:36 AM
    👋 seeing this issue on our CI/Jenkins environments while building KMP projects. looks like it's been open for a while; are we misconfiguring something or is the suggestion about the lazy caching of the device map a valid concern?
    t
    • 2
    • 1
  • d

    dead.fish

    05/05/2025, 3:05 PM
    Hi, I recently updated to KSP 2.1.20-1.0.32 (Kotlin 2.1.20) and get an exception when compiling:
    Copy code
    java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.incremental.IncrementalCompilationFeatures.<init>(boolean, boolean, boolean, boolean, boolean, int, kotlin.jvm.internal.DefaultConstructorMarker)'
            at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.makeIncrementalCompilationFeatures(AbstractKotlinCompile.kt:288)
            at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.makeIncrementalCompilationFeatures(KotlinCompile.kt:476)
            at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin_common(KotlinCompile.kt:331)
            at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin_common(KotlinCompile.kt:55)
            at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.executeImpl(AbstractKotlinCompile.kt:314)
            at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(AbstractKotlinCompile.kt:263)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
            at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:45)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
            at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.execute(IncrementalTaskAction.java:26)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
            at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:244)
    Anybody has seen this before?
    t
    • 2
    • 1
  • d

    dead.fish

    05/05/2025, 3:08 PM
    Switching off incremental compilation (via
    -Pkotlin.incremental=false
    ) fixes the issue. This seems to affect both Android and multiplatform projects.
  • j

    jw

    06/04/2025, 2:00 AM
    As of KGP 2.1 using
    associateWith
    on a custom compilation seems to depend on the jar output of the target compilation whereas in 2.0 it depended only on the classes. Depending on the jar is problematic because this is was a handy mechanism for creating multi-release jars. But with
    associateWith
    depending on the jar, this creates a task cycle. Is there some other way to do what
    associateWith
    was doing without depending on the jar?
    t
    • 2
    • 9
  • j

    jw

    10/02/2025, 6:40 PM
    The
    com.android.kotlin.multiplatform.library
    plugin creates a
    KotlinTarget
    (
    com.android.build.api.variant.impl.KotlinMultiplatformAndroidLibraryTargetImpl
    ) whose
    platformType
    is "jvm" as opposed to "androidJvm". @Sebastian Sellmair [JB] indicated on another Slack workspace that this was intentional. A few questions have come up related to this. How should we write code that operates on all targets (or a subset of them) and correctly differentiate JVM vs. Android. For example, Android differs from the JVM in having multiple variants by default, having two test compilations (times the number of product flavors), etc. Should we prefer doing type checks on the target instead of using
    platformType
    ? And the fact that this comes with extra burden when you have a
    compileOnly
    dependency on AGP, since you can no longer do a simple
    as? KotlinMultiplatformAndroidLibraryTarget
    without a try/catch on
    NoClassDefFoundException
    , or otherwise doing a
    Class.forName
    and then reflective
    isInstance
    .
    r
    s
    +4
    • 7
    • 12
  • t

    Timofey Solonin

    10/13/2025, 8:25 AM
    Hi folks. Last week, we published a KEEP design proposal for the new KMP library serialization format (the UKlib) and the overhaul of the dependency model. Your critique and thorny edge cases are welcome in the discussion for the KEEP.
    K 7
    m
    • 2
    • 1
  • m

    Marcin Mycek

    10/14/2025, 2:01 PM
    👋🏻 Looking for DSL design input! 🙂 Question to all people that write/edit (or look at) KMP Gradle build scripts: What things do you configure on the level of either: • low-level platforms (so
    linuxArm64
    yes, but not `linux`;
    macosX64
    yes, but not `macos`; etc.) ◦ Ignoring platforms that don't have lower-level (
    android
    and
    jvm
    ) :) • OR higher-level platforms that are not
    common
    (so
    native
    ,
    apple
    ,
    web
    , or any similar level custom source set) Please share: • What do you configure? Why? Is it app module or library module? ◦ What others have seen do? • Can you point me to the repository if it's public? Share a build script or part of it? If you want write a bit or just share a link - kodee loving thank you color ! If you have time to write more - kodee loving thank you color !