Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flame.audio.play crashes 'Future<dynamic>' is not a subtype of type 'Future<int>' #11

Closed
geulaproch opened this issue Jul 7, 2018 · 4 comments

Comments

@geulaproch
Copy link

In my project with Dart2, when I use Flame.audio.play, it prints following exception to the console.

[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
type 'Future<dynamic>' is not a subtype of type 'Future<int>'
#0      AudioPlayer.play (package:audioplayers/audioplayer.dart:28:16)
#1      Audio.play (package:flame/audio.dart:47:37)
<asynchronous suspension>
@luanpotter
Copy link
Member

Thanks for your feedback! What version of Flame are you using? This was fixed in audioplayers 0.5.1, which should be included in the latest version of flame. Could you verify that, please?

@geulaproch
Copy link
Author

Thank you for answer. Version of Flame: ^0.8.4. I didn't find newer version...

@luanpotter
Copy link
Member

I just released 0.9.0 with the new audioplayer version! See if that helps. Otherwise check in your pubspec.lock what version of audioplayers is being resolved :)

Indeed the latest released version of flame potentially allowed for an older version of audioplayers that didn't compatibility for Dart 2.

@geulaproch
Copy link
Author

Thank you! The new version works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants