简体   繁体   中英

How to make a Flutter Web App run in an Android Emulator

I have created a web app using Flutter and it is running fine. I wanted to create a mobile app out of it with as little modification to the code as possible and wanted to run it in an Android Emulator, so I installed Android Studio and then a device in ADV Manager. The code did not show any errors but Android Studio is not able to locate the newly installed device. Am I missing something?

The question could also be reframed as: how to convert a Flutter web app into a mobile app.

Source of this answer is: here

Can you try to run the below command in terminal:

flutter devices

Does it show something like this?

Android SDK built for x86 (mobile)

If not, then try to run the following commands:

  1. flutter config --android-sdk <path to android sdk>
  2. flutter config --android-studio-dir <path to android studio>

Replace with the actual path to the SDK in your machine.

And then restart your Android Studio. You should see your virtual device listed under Flutter Device Selection.

Please note, to find the path to Android SDK, you can go to Preferences as shown in this image
图片

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