需要在build.gradle文件中添加相应的依赖项。例如:
dependencies {
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.animation:animation:$compose_version"
implementation "androidx.compose.animation:animation-core:$compose_version"
}
其中,$compose_version是你所使用的Compose版本。添加依赖后,同步项目便可以成功解决这个未解决引用问题。
上一篇:androidx.cardview.widget.CardView上的涟漪效果
下一篇:androidx.compose.ui.tooling.preview.PreviewActivity不是活动子类或别名。