Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved reference: FlutterActivity

Tags:

flutter

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

enter image description here

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

Can someone please help me to fix this issue ?

Thankyou in advance.

like image 421
Sarvesh Dalvi Avatar asked Oct 09 '20 08:10

Sarvesh Dalvi


1 Answers

I got the solution for this.

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

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

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

enter image description here

Then click "OK".

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.

like image 55
Sarvesh Dalvi Avatar answered Sep 21 '22 02:09

Sarvesh Dalvi