Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory

倚欄靜望發表於2020-09-29

報錯“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'

相關文章