Flutter - Android Studio - Why is "Flutter attach" and "Hot reload" buttons greyed out on Android Studio?

435 Views Asked by At

I have an existing native Android app to which I am adding a Flutter module (as new screens of the app will be written in Flutter).

This is my project structure:

native_project
   app
   flutter_module
   network_module
   .
   .
   .

I can get hot reload to work by opening the terminal and manually navigating to native_project/flutter_module and then running flutter attach. After that, changes to the Flutter files can be hot reloaded from the terminal by typing "r".

I don't want to use the terminal for hot reloading though. Instead, I want to be able to use the "hot reload" button in Android Studio but no matter what I do, it is always grayed out:

enter image description here

You can see both the "Flutter Hot Reload" button (the lighting icon) and the "Flutter attach" button (the device icon with the Flutter icon on it) are greyed out (they are greyed out even when hot reloading is working from the terminal).

How can I get those buttons to work on Android Studio?

Here is my Android Studio configuration for Flutter SDK and Dart SDK:

enter image description here enter image description here

1

There are 1 best solutions below

6
On

Have you added flutter sdk path in project setting? if not goto file -> settings -> languages and frameworks -> flutter -> then select flutter SDK from the dropdown.

enter image description here