2

I made a Kotlin Multiplatform Mobile project using android studio and ran into the following error after importing SQLDelight:

e: This version (1.0.1) of the Compose Compiler requires Kotlin version 1.5.21 but you appear to be using Kotlin version 1.5.30 which is not known to be compatible.  Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).

I followed this question, however everything they mentioned I had already done correctly. After going file by file and failing to find where I had declared that version I decided to compare my project to one of the sample projects.

After going through the files again I found that I was using sqlDelightVersion 1.5.2 in my App grade.properties and they used 1.4.2 After changing it from 1.5.2 to 1.4.2 everything compiles.

Question is, why would something like this happen if SQLDelight has nothing to do with jetpack compose?

3
  • You might wanna edit the last line of the second last paragraph, the version numbers Commented Oct 19, 2021 at 4:56
  • 1
    most probably SQLDelight forces kotlin version to 1.5.30, while compose 1.0.1 requires kotlin 1.5.21. Update you compose to latest version which is 1.0.4 Commented Oct 19, 2021 at 6:36
  • I did just that which produced the same error but know saying it requires 1.5.31 and that I am using 1.5.30 which was still coming from DQLDelight since my Kotlin version was actually 1.5.21 but once I changed 1.5.21 to 1.5.31 that was solved too. Thanks for answering my questions. Commented Oct 19, 2021 at 7:27

1 Answer 1

1

Jetpack Compose is tightly bound to kotlin compiler version and it probably won't change soon (although, AFAIK, Google is talking to Jetbrains about stabilizing compiler plugin APIs for that NOT to happen. My source on that is a one of the Q&As with compose team).

If you want to use SQLDelight or any other library that is based on some other version of kotlin - you probably have to force proper kotlin version on gradle level (like here)

Sign up to request clarification or add additional context in comments.

2 Comments

Any idea why Compose even need a Kotlin compiler plugin?
The whole premise of compose syntax is based on kotlin compiler magic. It's a huge topic in itself. TLDR: kotlin compilar is the reason why we can use compose as simple functions and it just works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.