最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - How do you use Jetpack Compose on API 33 or earlier? - Stack Overflow

programmeradmin2浏览0评论

When I added androidxpose libraries as dependencies to my app, Android Studio automatically used version 1.7.8, and I got a build error saying that the versions I was installing require API 34, and I am currently building against API 33. I thought I could just downgrade the Compose version, but:

  • If I use 1.5.0, it still gives this error, but pointing at emoji libraries I'm not even directly depending on (androidx.emoji2:emoji2-views-helper:1.4.0 and androidx.emoji2:emoji2:1.4.0)
  • If I use 1.4.3 or earlier, Gradle complains it can't find the dependencies

How do I use Jetpack Compose on API 33? Is it even possible?

When I added androidxpose libraries as dependencies to my app, Android Studio automatically used version 1.7.8, and I got a build error saying that the versions I was installing require API 34, and I am currently building against API 33. I thought I could just downgrade the Compose version, but:

  • If I use 1.5.0, it still gives this error, but pointing at emoji libraries I'm not even directly depending on (androidx.emoji2:emoji2-views-helper:1.4.0 and androidx.emoji2:emoji2:1.4.0)
  • If I use 1.4.3 or earlier, Gradle complains it can't find the dependencies

How do I use Jetpack Compose on API 33? Is it even possible?

Share asked Mar 6 at 20:12 Bbrk24Bbrk24 9738 silver badges26 bronze badges 3
  • Rather than paraphrase the error message, please edit your question to provide the actual text of the error message. As part of doing that, you may determine that the error message is referring to compileSdk, not minSdk, and that Compose works fine on API Level 33. – CommonsWare Commented Mar 6 at 20:22
  • Sorry, I'm very new to Android, and most of my experience comes from iOS where those values can't be different (a single setting controls both). I wasn't aware that this was even a thing to look for and the complete lack of easy-to-find documentation on this class of error was frustrating. – Bbrk24 Commented Mar 6 at 20:27
  • 1 Understood! However, that is all the more reason to use the actual error message in your Stack Overflow questions. – CommonsWare Commented Mar 6 at 20:31
Add a comment  | 

1 Answer 1

Reset to default 1

A compile sdk version requirement means that the SDK your app is compiling against is too low for the library you are using. That does not mean that's the only version of Android you can use.

You can use Compose on any Android version SDK 21+. You need to set your minSdkVersion to the lowest you want to support, and the targetSdkVersion/compileSdkVersion should always be at the latest in your build.gradle file

发布评论

评论列表(0)

  1. 暂无评论