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

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

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


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

image.png

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

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


目录
相关文章
|
5月前
|
Android开发
Android studio 出现Plugin [id: ‘com.android.application‘, version: ‘8.1.0‘, apply: false] 问题解决办法
Android studio 出现Plugin [id: ‘com.android.application‘, version: ‘8.1.0‘, apply: false] 问题解决办法
1197 1
|
Android开发
清单文件合并失败Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4
清单文件合并失败Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4
清单文件合并失败Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4
This project uses AndroidX dependencies, but the ‘android.useAndroidX‘ property is not enabled
This project uses AndroidX dependencies, but the ‘android.useAndroidX‘ property is not enabled
204 0
|
Android开发
Android Studio 更新版本之后报错: Cannot access android.arch.lifecycle.ViewModelStoreOwner
Android Studio 更新版本之后报错: Cannot access android.arch.lifecycle.ViewModelStoreOwner
199 0
|
Android开发
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.C
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.C
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.C
|
NoSQL Java Android开发
Remote Configuration for Android using Alibaba Cloud Table Store
In this tutorial, you will learn how to use Table Store to create a simple user information database with a form accessible on mobile devices.
1645 0
|
Android开发 C++ 索引
Android resources.arsc的解析
写在前面的话 从写下这个标题开始,我就知道这篇文章需要几天的时间才能真正完成。当然不是因为一切从零开始,只是因为要整理的东西太多。说几句题外话,关于为啥要写这个resources.arsc文件的解析。
1061 0
|
Android开发
simple Android EventBus code
import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.
715 0