I'm making a Flutter app that uses the audio_service plugin. It works on Android, iOS and macOS. However when I run it on the web with Chrome I get the following error:
Launching lib/main.dart on Chrome in debug mode... lib/main.dart:1 ../../../../.pub-cache/hosted/pub.dartlang.org/audio_service-0.16.1/lib/js/media_metadata.dart:7:7: Error: JS interop class 'MediaMetadata' conflicts with natively supported class 'MediaMetadata' in 'dart:html'. class MediaMetadata { ^ Failed to compile application.
How do I work around this error before the issue is solved?
Instead of running your app from the IDE, run it from the command line:
flutter run -d chrome
This worked for me and was also reported to work here.
1.4m articles
1.4m replys
5 comments
56.9k users