apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Update Kotlin version

Open nicolas-raoul opened this issue 1 month ago • 8 comments

In gradle/libs.versions.toml change:

kotlin = "1.9.22"

to

kotlin = "2.1.0"

... then fix any build error.


Gemini also says to do the following, I am not sure how important it is:

  1. While you're in the [versions] section, you must also update your Compose BOM (Bill of Materials) to a version that's compatible with the new compiler.

    [versions]
    kotlin = "2.1.0"
    
    # Find your composeBom version and update it.
    # A version like 2024.05.00 or newer is needed.
    # Let's try a recent stable one (e.g., from January 2025):
    androidxComposeBom = "2025.01.00" 
    
  2. In the [plugins] section, you must add the new Compose Compiler plugin, which is now tied to the Kotlin version:

    [plugins]
    # You will see your existing plugins here
    jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
    kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
    # ...
    
    # Add this line:
    compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
    

In build.gradle.kts:

  1. DELETE the old composeOptions block. For Kotlin 2.0 and newer, this is no longer used.

    // DELETE THIS ENTIRE BLOCK:
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.8"
    }
    
  2. ADD the new plugin to your plugins block at the very top of the file:

    plugins {
        alias(libs.plugins.android.application)
        alias(libs.plugins.jetbrains.kotlin.android)
        alias(libs.plugins.kotlin.kapt)
        alias(libs.plugins.kotlin.parcelize)
        alias(libs.plugins.compose.compiler) // <-- ADD THIS LINE
    }
    

nicolas-raoul avatar Nov 05 '25 14:11 nicolas-raoul

Is that Copilot creating a pull request? How did it go with the upgrading task, @nicolas-raoul?

rohit9625 avatar Nov 09 '25 16:11 rohit9625

The above pull request is Copilot failing at solving this issue. šŸ˜‚

It is up for grab, for anyone who has better vibe skills (or human skills) than me. šŸ™‚

nicolas-raoul avatar Nov 10 '25 01:11 nicolas-raoul

Yep, there are so many changes that Copilot made. It might be breaking something.

rohit9625 avatar Nov 10 '25 13:11 rohit9625

I gave another try, let's see šŸ˜„

RitikaPahwa4444 avatar Nov 15 '25 07:11 RitikaPahwa4444

Hi! I’m Sangeeta Yadav. I’m new to Wikimedia and exploring the codebase for the first time. I have successfully set up the project, and I’m also preparing for GSoC 2026, so I want to start contributing slowly and learn the workflow.

I noticed that there were previous attempts on this issue. Is anyone currently working on it, or may I take this one? If someone else is already working on it, I would be grateful if you could recommend a good starting point for beginners.

Thank you! Excited to be a part of Wikimedia! 😊

CodeWithSangeeta avatar Dec 05 '25 18:12 CodeWithSangeeta

Hi Sangeeta, welcome to the community! :)

I noticed that there were previous attempts on this issue. Is anyone currently working on it, or may I take this one?

Yes, Nicolas and I were trying to vibe-code it using Copilot to see its capabilities šŸ˜…

Copilot created #6558 and Paul added a suggestion too, but I didn't get enough time to take a pull and review locally. There are two ways you could go about this - either review that PR (and we can ask Copilot to follow your suggestions 😁) or raise a new PR, whichever way you find easier.

Note: The PR might be complete, we just need to test, review the docs and confirm. Please feel free to comment there if you're testing it and it looks good to you or take it as a reference for your PR.

RitikaPahwa4444 avatar Dec 05 '25 22:12 RitikaPahwa4444

This issue has already been assigned. Please find another issue to work on: https://github.com/commons-app/apps-android-commons/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug%20no%3Aassignee%20-label%3A%22low%20priority%22%20-label%3Adebated%20-label%3Aupstream

github-actions[bot] avatar Dec 05 '25 22:12 github-actions[bot]

Thanks, Ritika! I will start by testing the existing PR locally and will add feedback or improvements there. This feels like the best place to begin. 😊

CodeWithSangeeta avatar Dec 06 '25 10:12 CodeWithSangeeta