简体   繁体   中英

Add Android Run/Debug configuration for Flutter project

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM