news 2026/6/9 23:11:00

material3 问题:requires libraries and applications that depend on it to compile against version 35

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
material3 问题:requires libraries and applications that depend on it to compile against version 35
[versions] androidx-material3 = "1.4.0" [libraries] androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidx-material3" }
  • 在 Android 开发中,使用 Jetpack Compose 时,使用 material3 时,出现如下错误信息
13 issues were found when checking AAR metadata: 1. Dependency 'androidx.compose.material3:material3-android:1.4.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34. Recommended action: Update this project to use a newer compileSdk of at least 35, for example 35. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). ... Update minCompileSdk in modules with dependencies that require a higher minCompileSdk.
问题原因
  • material31.4.0版本要求compileSdk 35或更高版本,而当前项目为compileSdk 34
处理策略
  • 这里选择降级 material3 的版本,将1.4.0降级为1.3.2
// 原来是这样的 [versions] androidx-material3 = "1.4.0" [libraries] androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidx-material3" }
// 修改成这样 [versions] androidx-material3 = "1.3.2" [libraries] androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidx-material3" }
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/10 10:51:07

JVM 性能调优流程实战:从开发规范到生产应急排查

JVM 性能调优全流程实战:从开发规范到生产应急排查 核心原则 JVM 调优不是 “上线后才做”,而是贯穿开发全流程的工程实践: 开发阶段:提前规避内存泄漏、减少临时对象创建(从根源减少 GC 压力);…

作者头像 李华
网站建设 2026/6/10 10:54:27

React Native鸿蒙:ImageBackground背景图适配

React Native for OpenHarmony 实战:ImageBackground 背景图适配 在当今移动应用开发中,视觉表现力往往是吸引用户的第一要素。背景图作为提升界面沉浸感和美观度的关键手段,在登录页、个人中心、启动屏等场景中应用极为广泛。然而&#xff…

作者头像 李华
网站建设 2026/6/10 10:53:18

React Native鸿蒙版:View弹性盒子布局

React Native鸿蒙版:View弹性盒子布局 在当今跨平台移动开发领域,React Native 凭借其“Learn Once, Write Anywhere”的理念,极大提升了开发效率。随着 OpenHarmony 生态的日益繁荣,将 React Native 应用运行在 OpenHarmony 6.0…

作者头像 李华
网站建设 2026/6/10 12:31:59

现代语音识别组件:从深度特征到端到端系统的演进与实战

好的,这是为您精心撰写的关于现代语音识别组件的深度技术文章。 现代语音识别组件:从深度特征到端到端系统的演进与实战 引言 语音识别,或称自动语音识别,已从实验室走向千家万户,但其核心技术栈的演进远未停止。传…

作者头像 李华
网站建设 2026/6/10 12:35:42

用React Native开发OpenHarmony应用:ScrollView滚动条样式定制

用React Native开发OpenHarmony应用:ScrollView滚动条样式定制 摘要 在跨平台应用开发中,滚动视图是最核心的交互容器之一,而滚动条样式往往直接影响用户体验的细腻程度。本文基于React Native 0.72.5和OpenHarmony 6.0.0 (API 20)环境&…

作者头像 李华