Skip to content

Fix build failure: Remove Kotlin 2.0+ compose-compiler plugin for 1.9.25 compatibility#2

Merged
ageon1156 merged 2 commits into
mainfrom
copilot/fix-build-failure-kotlin-plugin
Jan 22, 2026
Merged

Fix build failure: Remove Kotlin 2.0+ compose-compiler plugin for 1.9.25 compatibility#2
ageon1156 merged 2 commits into
mainfrom
copilot/fix-build-failure-kotlin-plugin

Conversation

Copilot AI commented Jan 22, 2026

Copy link
Copy Markdown

The build was attempting to use org.jetbrains.kotlin:compose-compiler-gradle-plugin which doesn't exist for Kotlin 1.9.x (introduced in 2.0+).

Changes

gradle/libs.versions.toml

  • Added compose-compiler = "1.5.14" (Kotlin 1.9.25 compatible version)
  • Commented out compose-gradlePlugin library and compose-compiler plugin references

build-logic/convention/build.gradle.kts

  • Removed compileOnly(libs.compose.gradlePlugin) dependency

build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/AndroidCompose.kt

  • Replaced Kotlin 2.0+ ComposeCompilerGradlePluginExtension configuration with legacy composeOptions:
commonExtension.composeOptions {
    kotlinCompilerExtensionVersion = libs.version("compose-compiler")
}
  • Removed compiler metrics/reports/stability configuration (unavailable in 1.9.x)

Convention plugins

  • Removed compose-compiler plugin application from AndroidApplicationComposeConventionPlugin, AndroidLibraryComposeConventionPlugin, and KmpLibraryComposeConventionPlugin

Trade-offs

Compose compiler metrics and reports are unavailable until Kotlin 2.0+ upgrade.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:MaxMetaspaceSize=2g -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx8g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon (dns block)
  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:MaxMetaspaceSize=2g -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx8g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Problem

The build is failing with the following error:

Execution failed for task ':build-logic:convention:compileKotlin'.
> Could not resolve all files for configuration ':build-logic:convention:compileClasspath'.
   > Could not find org.jetbrains.kotlin:compose-compiler-gradle-plugin:1.9.25.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/jetbrains/kotlin/compose-compiler-gradle-plugin/1.9.25/compose-compiler-gradle-plugin-1.9.25.pom
       - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/compose-compiler-gradle-plugin/1.9.25/compose-compiler-gradle-plugin-1.9.25.pom
       - https://jitpack.io/org/jetbrains/kotlin/compose-compiler-gradle-plugin/1.9.25/compose-compiler-gradle-plugin-1.9.25.pom
     Required by:
         project :build-logic:convention

Root Cause

The compose-compiler-gradle-plugin was introduced in Kotlin 2.0+ and does not exist for Kotlin 1.9.x versions. The current configuration in gradle/libs.versions.toml references:

compose-gradlePlugin = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }

Where kotlin = "1.9.25" - but this plugin doesn't exist for that version.

The dependency is used in build-logic/convention/build.gradle.kts on line 48:

compileOnly(libs.compose.gradlePlugin)

Required Changes

  1. gradle/libs.versions.toml:

    • Add a separate compose-compiler version that is compatible with Kotlin 1.9.25 (use 1.5.14 which is the latest compatible version)
    • Remove or update the compose-gradlePlugin library reference since org.jetbrains.kotlin:compose-compiler-gradle-plugin doesn't exist for Kotlin 1.9.x
  2. build-logic/convention/build.gradle.kts:

    • Remove the compileOnly(libs.compose.gradlePlugin) dependency on line 48 since this plugin doesn't exist for Kotlin 1.9.x
  3. Update any Compose convention plugins (e.g., AndroidLibraryComposeConventionPlugin.kt, AndroidApplicationComposeConventionPlugin.kt) to use kotlinCompilerExtensionVersion instead of the Kotlin Compose plugin approach:

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.14"
    }
  4. Remove the compose-compiler plugin reference from libs.versions.toml plugins section (line 206) if it causes issues:

    # Remove: compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

Compatibility Matrix

Component Version
Kotlin 1.9.25
Compose Compiler 1.5.14
AGP 8.1.2
Gradle 8.5

Verification

After the fix, running ./gradlew :build-logic:convention:compileKotlin should complete successfully without the "Could not find" error.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Remove compose.gradlePlugin dependency from build-logic/convention/build.gradle.kts
- Comment out compose-gradlePlugin library in libs.versions.toml (doesn't exist for Kotlin 1.9.x)
- Comment out compose-compiler plugin in libs.versions.toml (doesn't exist for Kotlin 1.9.x)
- Add compose-compiler version 1.5.14 compatible with Kotlin 1.9.25
- Update AndroidCompose.kt to use old-style kotlinCompilerExtensionVersion
- Update convention plugins to not apply the compose-compiler plugin
- Remove ComposeCompilerGradlePluginExtension configuration (not available in Kotlin 1.9.x)

Co-authored-by: ageon1156 <140043221+ageon1156@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build failure due to missing compose compiler gradle plugin Fix build failure: Remove Kotlin 2.0+ compose-compiler plugin for 1.9.25 compatibility Jan 22, 2026
Copilot AI requested a review from ageon1156 January 22, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants