rive-app / rive-flutter

Flutter runtime for Rive
https://rive.app
MIT License
1.16k stars 180 forks source link

Problem in loading multiple asset rives. #401

Open akanksha-coditas opened 1 week ago

akanksha-coditas commented 1 week ago

Description

I'm encountering an issue with preloading Rive files using RiveFile.asset() in flutter web. For some files, the preloading works as expected, but for others, it throws exceptions. Interestingly, the files that cause exceptions when preloaded with others work fine when loaded individually. This problem occurs only when the files are loaded from hosted URLs.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add approx 10-12 rive files of less than 3mb size in assets directory.
  2. Now try to preload all the rives.
  3. Few will be loaded and then will get an error saying
Screenshot 2024-06-20 at 5 15 36 PM

Expected behavior

<-- A clear and concise description of what you expected to happen. --> I wanted to preload all the rives at the initial state only and later on as per the requirement will render it on the screen using RiveFile.direct(riveFile).

Device & Versions (please complete the following information)

HayesGordon commented 1 week ago

Hi @akanksha-coditas,

I'd like to confirm. Is this only an issue if the .riv file contains hosted out-of-band assets? It appears that the image data is corrupt.

If you have an example project (or .riv files) you can share with us that reproduces the issue that will be really helpful in speeding along our investigation.

akanksha-coditas commented 1 week ago

Hi @akanksha-coditas,

I'd like to confirm. Is this only an issue if the .riv file contains hosted out-of-band assets? It appears that the image data is corrupt.

If you have an example project (or .riv files) you can share with us that reproduces the issue that will be really helpful in speeding along our investigation.

Regarding the out-of-band asset, I am unsure. Additionally, I only see this problem when I load more than 6-7 rives at once; otherwise, everything functions as it should. Furthermore, it isn't targeting any particular file. Additionally, it makes no exceptions when I load files one at a time.

Also, I apologise, but since those are client files, I am unable to give them to you.

HayesGordon commented 6 days ago

We can try to reproduce this issue on our end, but if you can provide a reproducible sample, or share how you are using the runtime code that'll be helpful. If we're unable to reproduce it'll be difficult to resolve the issue.

Could you give more information on this: "This problem occurs only when the files are loaded from hosted URLs."