未解决的参考:FlutterActivity [英] Unresolved reference: FlutterActivity

查看:72
本文介绍了未解决的参考:FlutterActivity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一些有关如何用flutter编写本机代码的问题.在Android中打开MainActivity.kt文件时,我遇到了这些问题.

I was researching a bit about writing native code in flutter. On opening the MainActivity.kt file in android I faced these issues.

在突出显示错误时,它显示未解决的参考:FlutterActivity".

On highlighting the error it showed 'Unresolved reference: FlutterActivity'.

有人可以帮我解决此问题吗?

Can someone please help me to fix this issue ?

先谢谢您.

推荐答案

我已经找到了解决方案.

I got the solution for this.

如果您要编写本机代码或编辑现有的本机代码,则必须打开"android"专案的一部分.

If you want to write native code or edit existing native code you have to open the "android" part of your project specifically.

您可以执行以下操作:File->打开.....

You can do that be going to : File -> Open .....

然后浏览至您当前的项目并选择其"android"文件夹并打开它:

Then browse to your current project and select its "android" folder and open it :

然后单击确定".

它将打开项目的android native部分.如果您通过此路径打开MainActivity,所有错误都将消失.

It will open the android native part of your project. All the errors will be gone if you will open the MainActivity through this path.

这篇关于未解决的参考:FlutterActivity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆