FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
125 stars 25 forks source link

Lottie animations cause app crash and throw "PersistedOffset: is in an unexpected state" error #4778

Open walik-walik opened 1 week ago

walik-walik commented 1 week ago

Can we access your project?

Current Behavior

Using Lottie animations in FlutterFlow version 5.0.9 causes the Chrome web app to crash. A repeating error message—"Another exception was thrown: PersistedOffset: is in an unexpected state"—appears in the console. Additionally, attempting to replace one Lottie animation with another does not work, and no specific error message is provided for this issue.

Expected Behavior

Lottie animations should load and display correctly without causing the Chrome web app to crash. Replacing one Lottie animation with another should work seamlessly, allowing for a smooth swap without errors or interruptions.

Steps to Reproduce

  1. Open an existing or new project in FlutterFlow version 5.0.9.
  2. Add a Lottie animation widget to any screen in the project.
  3. Attempt to preview or run the project as a web application in the Chrome browser.
  4. Observe the console for the repeating error message: "Another exception was thrown: PersistedOffset: is in an unexpected state."
  5. Next, try replacing the initial Lottie animation with a different Lottie file in the widget’s properties.
  6. Notice that the replacement animation does not load or display as expected, and there is no specific error message indicating why the swap failed.

Note: The issue appears specific to FlutterFlow 5.0.9 and affects only the Chrome web preview, as other environments may behave differently.

Reproducible from Blank

Bug Report Code (Required)

IT4KlM/l34xOtbxZ1s7fbcdFmikXJmY6UIIKlutuURMaF4PkG7YuQs+lVBJtXdOQTFZiPVqWmnsypq3ZudrtFPoVE0+ub4dq3bt5WA7jUk6uMp/RDZeaXnFTJ59nFXGO5JiJpAx9FPFfLXw6wV+YFt+/VgXaHqbjDFcNBfmHBJLMnlKGKyLjVxFJ5CdecCfn

Visual documentation

https://github.com/user-attachments/assets/fff052be-be8b-4fb4-990b-bc507ecb1ec2

https://github.com/user-attachments/assets/9cafb4c3-305e-4bb0-8b75-d5572941d2aa

Bildschirmfoto 2024-10-30 um 10 58 50

Environment

- FlutterFlow version: 5.0.9
- Platform: We and MacOS Desktop
- Browser name and version: Chrome Version 130.0.6723.71 
- Operating system and version affected: macOS Sequia 15.0.1 (24A348)

Additional Information

No response

Alezanello commented 1 week ago

Hello!

I wasn’t able to replicate the issue on my end. However, I’ve shared a public project below where I attempted to replicate it. Feel free to clone, modify, and test it as needed. Please let me know if there’s anything specific I might have missed!

https://app.flutterflow.io/project/qa-2927-4you4q

walik-walik commented 2 days ago

Hello!

Thank you for sharing the public project for testing. I’ve cloned and tested it on my end, and I am still experiencing the same issue. When running the app in the Chrome browser, it crashes, and I see the "PersistedOffset: is in an unexpected state" error looping in the console.

Additionally, I receive the following warning message in FlutterFlow: "Warning: Box Fit and Frame Rate properties may not be working properly. Try reentering the Network Path or reselecting the Asset to fix this."

In the FlutterFlow editor, the Lottie animation displays correctly. However, in the Chrome browser, the animation does not display, and the error appears in a loop as mentioned.

To help with diagnosis, I’m also attaching the JSON file for the Lottie animation I used. The error occurs with this file as well as with other Lottie animations, and I am also unable to select new animations after encountering the error.

Please let me know if there are any additional steps or configurations you recommend. I’m happy to try any suggestions that might help isolate the cause.

Thanks again for your assistance! Trophy.json

walik-walik commented 2 days ago

I noticed that the error seems to occur specifically when using Local Run. When the app is hosted normally, the Lottie animations work fine without any issues. However, during Local Run in the Chrome browser, the app crashes, and I see the "PersistedOffset: is in an unexpected state" error looping in the console.

Since it looks like you weren't able to reproduce the issue before, could you please try testing it with Local Run? This might help in identifying the cause of the problem.

Thank you for your assistance!