Hi, I want to ask why I can't run web apps on a flutter emulator or android studio. I want to make a testing video call using the emulator but when I run it, an error appears about importing 'dart:html'; , import 'dart:js' as js; , late File selectedFile; and Exception: Gradle task assembleDebug failed with exit code 1. When I run using chrome this error is not there. How do I want to do it? Is there another way to try to run using an emulator or android studio?
Asked
Active
Viewed 38 times
1 Answers
0
From my understanding, you have a flutter web app that you want to test on an android device (in an emulator)
Run the app with this command:
flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0
Make sure the port is open and then go to http://>your-ip>:8080 (it should provide a link as well after running)
Here's the source and please do check it as there are a few useful answers about this: How to run Flutter Web on mobile chrome from IDE

Robert Pietraru
- 79
- 2
- 6