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?

3
  • Can you show the assets part of your pubspec.yaml? Commented Apr 8, 2023 at 21:56
  • Forgot I had to include them there lol, thank you for reminding me! Commented Apr 8, 2023 at 22:02
  • In case it fixes your problem, please create an answer for you question explaining the solution and mark as resolved :) Commented Apr 8, 2023 at 22:05

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.