Is the minCompileSDK of jetpack compose 1.5 API level 34? – Android

by
Ali Hasan
android android-gradle-plugin android-jetpack-compose

Quick Fix: Yes, minCompileSDK for Jetpack Compose 1.5 is API level 34. To use Jetpack Compose with lower API levels, you can set compileSdkPreview to "UpsideDownCake" in defaultConfig in build.gradle(app-level). This will allow you to use the "UpsideDownCake" preview API until it is promoted to a stable API.

The Problem:

Jetpack Compose 1.5 was recently released with a compileSDK of 34, which is still in beta and not publicly available. This leads to dependency issues with libraries like emoji2 requiring a minimum SDK of 34. The direct use of emoji2 is not the main issue, but the dependencies it brings in. Is overriding the dependency versions in the build.gradle file the most suitable solution, or is this a dependency bug where stable dependencies have dependencies on beta SDKs?

The Solutions:

Solution 1: Using compileSdkPreview

If you want to use some newer Library versions, you have to use the latest CompileSDK Version. Add the below code in build.gradle(app-level) in defaultConfig.

android {
    defaultConfig {
        ...
        compileSdkPreview = "UpsideDownCake"
        ...
    }
}

Q&A

Is the minCompileSDK of Jetpack Compose 1.5 API level 34?

No, the minCompileSDK for Jetpack Compose 1.5 is API level 21.

What is the best way to resolve the dependency issue when using Jetpack Compose 1.5 with compileSDK = 33?

Add compileSdkPreview = "UpsideDownCake" to defaultConfig in build.gradle(app-level).

Is the dependency issue with Jetpack Compose 1.5 a bug?

It is unclear whether the dependency issue is a bug or not.

Video Explanation:

The following video, titled "Is the minCompileSDK of jetpack compose 1.5 API level 34 ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

Is the minCompileSDK of jetpack compose 1.5 API level 34? I hope you found a solution that worked for you 🙂 The Content (except music ...