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'


目录
相关文章
|
4月前
|
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] 问题解决办法
693 1
|
存储 缓存 API
Android Internal和External Storage
Android Internal和External Storage
132 0
|
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
|
缓存 Java API
Preference组件探究之Base,Support及AndroidX对比
Preference组件探究之Base,Support及AndroidX对比
Preference组件探究之Base,Support及AndroidX对比
|
Android开发
【错误记录】前台进程报错 ( Permission Denial: startForeground requires android.permission.FOREGROUND_SERVICE )
【错误记录】前台进程报错 ( Permission Denial: startForeground requires android.permission.FOREGROUND_SERVICE )
585 0
【错误记录】前台进程报错 ( Permission Denial: startForeground requires android.permission.FOREGROUND_SERVICE )
|
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
when is extension component's resource bundle loaded
Created by Wang, Jerry, last modified on May 20, 2015
100 0
when is extension component's resource bundle loaded
|
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.
1643 0
|
API Android开发 开发工具
(转)Android Studio Error:Failed to resolve: com.android.support:appcompat-v7:25.1.0解决方案
今天不知道为什么导入eclipse项目后就出现了错误,没导入之前是正常使用AS的 Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:25.+ 第一、点击Install Repository 。
3436 0