首页 > 解决方案 > 无法访问“com.ex.app.MainActivity”的超类型“android.arch.lifecycle.LifecycleOwner”

问题描述

我在 android studio 中创建了一个新的颤振项目,然后“打开项目”它的 android 部分,我在 MainActivity.kt 中遇到了一个错误,但是它成功构建了。

在此处输入图像描述

我的班级路径是:

在此处输入图像描述

最后我的依赖是:

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

如果有人可以帮助我,我将不胜感激。

标签: flutterkotlinflutter-dependencieskotlin-gradle-plugin

解决方案


我面临同样的问题,现在它在我的情况下解决了

第 1 步:在 AndroidStudio 中打开您的项目
第 2 步:打开终端并在终端中转到您的项目路径
第 3 步:点击此命令 ' git clean -xfd '
第 3 步:转到:文件 -> 使缓存无效/重新启动


推荐阅读