[英]while running the flutter app i am getting this error
Type mismatch: inferred type is Activity?类型不匹配:推断类型是 Activity? but Activity was expected
但预计会有活动
FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。
Compilation error.
编译错误。 See log for more details
有关详细信息,请参阅日志
Run with --stacktrace option to get the stack trace.
使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志输出。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
If you have not added kotlin configuration, then plz add below line in android/build file如果您还没有添加 kotlin 配置,请在 android/build 文件中添加以下行
buildscript {
ext.kotlin_version = '1.6.10'
.
.
.
And also add classpath right as below:并添加类路径,如下所示:
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
.
.
.
Could you be more specific on what and where is this problem happening.您能否更具体地说明这个问题发生在什么地方以及发生在哪里。 This error is telling you that the type expected is
Activity
instead of the nullable type Activity?
此错误告诉您预期的类型是
Activity
而不是可为空的类型Activity?
. .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.