背景
FragmentでJetpack Composeを使う時の書き方を以前書きましたが、Fragmentに対してComposeやろうとしたらエラーになったので、その備忘録
エラー時のgradle
implementation 'androidx.appcompat:appcompat:1.2.0'
エラー内容
Process: com.example.mapping_sample, PID: 15392
java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from androidx.constraintlayout.widget.ConstraintLayout{81a9941 V.E...... ......I. 0,0-0,0 #7f080076 app:id/container}
at androidx.compose.ui.platform.WindowRecomposer_androidKt.createLifecycleAwareViewTreeRecomposer(WindowRecomposer.android.kt:242)
解決したgradle
implementation 'androidx.appcompat:appcompat:1.3.0'
ここにはハマった・・・汗