
在Androidx项目中遇到如下警告
Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory

这个警告不耽误项目的正常使用,但是看着很不舒服,解决方案就是 在项目的build.gradle文件中加入一下依赖
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
我也很纳闷,为啥加上这个依赖就不提示这个警告呢?
在Androidx项目中遇到如下警告
Cannot access androidx.lifecycle.HasDefaultViewModelProviderFactory
这个警告不耽误项目的正常使用,但是看着很不舒服,解决方案就是 在项目的build.gradle文件中加入一下依赖
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
我也很纳闷,为啥加上这个依赖就不提示这个警告呢?
本文标题:Cannot access androidx.lifecycle
本文链接:https://www.haomeiwen.com/subject/cucbgktx.html
网友评论