I am working with a Flutter example project where it shows how to share a FlutterView inside an Android application (and iOS also).

While working with it I tried this:

I make changes to the android project like changing the theme color, if I do hot-reload/run for main.dart I don't see the changes reflected in the running app. I have to stop it from Android Studio and run the main.dart again to see the changes.

To solve the issue I was thinking to add a run/debug configuration for Android app module. So that I could run android app and not main.dart.

Is there a way how to achieve this in Android Studio?

One solution for me was to open the android(/flutter_view/android/app) project from a new window in Android studio. I could run the app this way.

(But here I encountered another issue in case anyone has the solution).


Solution 1: Feisal Aswad

According to my understanding you face problems when you open your project and try to run. Android studio asks you to configure your project to be able to run...

It's easy to solve near to run button you will find "add configuration" button just press then from left side select "flutter" and put in the field "entrypoint" your main Dart file path main.dart... EX. E:/project/lib/main.dart....

Then from top right corner press "create configuration"... That's it.


Solution 2: Vishal_VE

For Configure your Flutter app on Android you have to Upgrade Gradle file..

So Go to the Tool and at you will find AGP upgrade Assistant.. It Download new Gradle file then its Config automatic..