flutter - 无法访问“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'
如果有人可以帮助我,我将不胜感激。
解决方案
我面临同样的问题,现在它在我的情况下解决了
第 1 步:在 AndroidStudio 中打开您的项目
第 2 步:打开终端并在终端中转到您的项目路径
第 3 步:点击此命令 ' git clean -xfd '
第 3 步:转到:文件 -> 使缓存无效/重新启动
推荐阅读
- c# - 试图找到俯仰和偏航以转向 3d 空间中的对象
- mysql - 将索引大小从 255 更改为 191 会导致数据丢失吗?
- airflow - 重新安排模式下的气流传感器:在戳之间存储计数器状态的最佳实践?
- r - 从一个数据帧计算发生率,将结果输入到不同的数据帧
- node.js - IIS web.config 使用 POST 数据重写规则到 Node.js 应用程序
- python - Flask-mail 创建独立的邮件而不是电子邮件线程
- php - 未定义索引:第 [LineNumber] 行 [Path] 中的版本
- javascript - 将.vue中的日期时间格式化javascript函数格式化为服务器端实体框架查询
- java - 在 Java 中使用套接字解析和发送 HTTP 请求的正确方法是什么?
- drake - Colab暂存器NameError:未定义名称“underactuated”