1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

FragmentのComposeエラー:ViewTreeLifecycleOwner not found from androidx.constraintlayout.widget.ConstraintLayout

Last updated at Posted at 2021-06-09

背景

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'

ここにはハマった・・・汗

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?