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'


目录
相关文章
|
Android开发
android学习之——Gradle sync failed: Could not determine artifacts for xxxxx
android学习之——Gradle sync failed: Could not determine artifacts for xxxxx
android学习之——Gradle sync failed: Could not determine artifacts for xxxxx
|
4月前
|
开发工具 Android开发
解决Manifest merger failed : android:exported needs to be explicitly specified for <activity>
解决Manifest merger failed : android:exported needs to be explicitly specified for <activity>
105 1
|
数据库 Android开发 开发者
Android 开发四大组件(Activity、Service、Broadcast Receiver、Content Provider)
Android 开发四大组件(Activity、Service、Broadcast Receiver、Content Provider)
167 0
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
211 0
|
Android开发
Android Studio 更新版本之后报错: Cannot access android.arch.lifecycle.ViewModelStoreOwner
Android Studio 更新版本之后报错: Cannot access android.arch.lifecycle.ViewModelStoreOwner
205 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
|
开发工具
Could not get unknown property ‘versions‘ for object of type com.android.build.gradle.AppExtension
Could not get unknown property ‘versions‘ for object of type com.android.build.gradle.AppExtension
1744 0
Could not get unknown property ‘versions‘ for object of type com.android.build.gradle.AppExtension
|
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.
1651 0