0

I'm trying to incorporate some rive animations into my flutter app. The problem is only some animations load correctly and I can't figure out why. For example, this code works fine:

class _GardenPage extends State<GardenPage> {

  @override
  Widget build(BuildContext context) {

    return Column(
      children: const [
        Text("Garden Page"),

        Center(
          child: RiveAnimation.asset(
            'lib/assets/riveAnimations/login_screen_character.riv',
          ),
        )
      ],
    );
  }
}

The "login_screen_character.riv" is just a default animation from the rive website and loads fine.

When I try loading an animation of my own, or even some other default animations from the rive website, I get an Unable to load asset: lib/assets/riveAnimations/flower_test.riv error.

I don't change anything else besides the file name, all of the animations are in the same folder and I'm sure the names are correct, so I'm not sure what's not working. Any ideas?

Alex
  • 39
  • 5

1 Answers1

0

Forgot to include the asset in my pubspec.yaml file. Including it fixed the issue.

Alex
  • 39
  • 5