我升级到 Jetpack Compose 1.0.0-alpha12 并开始遇到问题。
首先,setContent我使用的方法显示为已弃用。
从Alpha 12 发行说明中,我注意到它说:
ComponentActivity.setContent 已移至 androidx.activity:activity-compose 模块中的 androidx.activity.compose.setContent。( icf416 )
所以我删除了 myimport androidx.compose.ui.platform.setContent并将其切换为import androidx.activity.compose.setContent,从而删除了弃用。
但是,然后我收到一个错误消息:
w: Flag is not supported by this version of the compiler: -Xallow-jvm-ir-dependencies
w: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+NonParenthesizedAnnotationsOnFunctionalTypes
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
e: Classes compiled by …Run Code Online (Sandbox Code Playgroud)