Cannot access ‘androidx.lifecycle.HasDefaultViewModelProviderFactory‘ which is a supertype of ‘com.e

2022-02-09 14:18:05 浏览数 (3)

Cannot access ‘androidx.lifecycle.HasDefaultViewModelProviderFactory’ which is a supertype of ‘com.example.a19.MainActivity’. Check your module classpath for missing or conflicting dependencies

今天创建了个项目,突然出现了这样的问题,怎么处理都没用,网上找了一堆没发现答案,故此记录。

增加这个依赖到你的build即可解决。

代码语言:javascript复制
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

0 人点赞