当前位置: 代码迷 >> 综合 >> Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory
  详细解决方案

Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory

热度:97   发布时间:2024-02-24 00:51:02.0

报错“Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory” 可正常运行

解决方法:

添加库:

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'

或者更新androidx.appcompat:appcompat:

    implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
  相关解决方案