-1

When trying to run my Flame application I get the following error:

Error: Cannot run with sound null safety, because the following dependencies don't support null safety:

  • package:flame
  • package:ordered_set
  • package:box2d_flame

I have the following in my pubspec.yaml file:

dependencies:
  flame: ^0.29.4
  flame_box2d: ^0.0.1
spydon
  • 9,372
  • 6
  • 33
  • 63
Hamou Ouyaba
  • 913
  • 1
  • 4
  • 17
  • Does this answer your question? [Cannot run with sound null safety because dependencies don't support null safety](https://stackoverflow.com/questions/64917744/cannot-run-with-sound-null-safety-because-dependencies-dont-support-null-safety) – Md. Yeasin Sheikh Nov 10 '21 at 05:37
  • flame and box2d_flame packages not yet updated for Null safety, you should use different package or wait for package developers to update – Shashi kumar S Nov 10 '21 at 05:38
  • Hi, one of the authors of Flame here, just use this in your pubspec file instead (0.26.x doesn't support null safety): Under your `dependencies:` section add: `flame: 1.0.0-releasecandidate.16` and `flame_forge2d: 0.8.2-releasecandidate.15`. box2d_flame has been renamed to flame_forge2d. – spydon Nov 10 '21 at 10:14

1 Answers1

2

Flame 0.29.4 doesn't support null safety, you can use the latest release candidate of version 1.0.0 if you want null safety (it is more stable than 0.29.4 anyways, and all the docs are for that version).

To use the newest release candidate together with Forge2D, put the following in your pubspec.yaml file:

dependencies:
  flame: ^1.0.0-releasecandidate.16
  flame_forge2d: ^0.8.2-releasecandidate.15

Do note that box2d_flame has been renamed to flame_forge2d, since the physics engine is now called Forge2D.

spydon
  • 9,372
  • 6
  • 33
  • 63