airbnb / lottie-ios

An iOS library to natively render After Effects vector animations
http://airbnb.io/lottie/
Apache License 2.0
25.74k stars 3.74k forks source link

Animation Frame appears unexpectedly and freezes app #2493

Open Mattheisen opened 5 days ago

Mattheisen commented 5 days ago

Which Version of Lottie are you using?

Lottie 4.4.0

Expected Behavior

App UI screen shall appear after animation has finished

Actual Behavior

A frame (last frame?) of the previous animation appears and blocks any further progress.

Animation JSON

The animation itself is not the issue. Various animations in my app are executed correctly. Also the one from which (the last?) frame appears unexpectedly.

Description of the issue in detail:

A certain process in our app consists of the following steps:

  1. User decision via UI
  2. Animation start while a process loads data from the backend.
  3. Load from backend completes successfully
  4. Started Animation is ended
  5. UI screen appears for the user to enter a PIN code for unlocking the screen
  6. User enters correct PIN
  7. App's main menu appears with the recent data from the backend.

All this 1 - 8 worked fine with 3.5.0. Starting with 4.4.0 the UI unexpectedly shows the image of the animation after step 6. Step 7 is never reached. The app is not reacting to any touch or whatever.

My investigation

I tried to find the exact change of your SDK from which this error is appearing. I applied your versions one by one until the error appears. While 4.3.4 is still working, the error appears with 4.4.0 (and later versions). Reading your 4.4.0 change notes, I suspected the issue to be caused by your change number #2254

My temporary fix

I debugged your code and assumed an error in your function VisibilityAnimation. I changed the code line 17 from if context.mustUseComplexTimeRemapping { to if context.mustUseComplexTimeRemapping != true { ...and then the error was gone. I cannot tell you why this made the difference. This is for you to find out ;-) but hopefully this can help you to find the root-cause of the problem.

Kindly let me now the outcome of your investigation.

calda commented 5 days ago

For us to take a look you'd need to share a copy of the animation json and also maybe sample code that demonstrates the issue.

Mattheisen commented 5 days ago

Hi Cal,

Please find the json file attached.

Best regards Peter

On Tue, Oct 22, 2024 at 3:40 PM Cal Stephens @.***> wrote:

For us to take a look you'd need to share a copy of the animation json and also maybe sample code that demonstrates the issue.

— Reply to this email directly, view it on GitHub https://github.com/airbnb/lottie-ios/issues/2493#issuecomment-2429321103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS22DJ4LLQNFFXTO7TNH23LZ4ZIU3AVCNFSM6AAAAABQMLPQWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRZGMZDCMJQGM . You are receiving this because you authored the thread.Message ID: @.***>

calda commented 5 days ago

The attachment didn't come through from the email to the github issue UI.

Mattheisen commented 5 days ago

JSON file: generalPurpose.json

Mattheisen commented 5 days ago

Hi,

I have added it to the issue in github.

Best regards Peter

On Tue, Oct 22, 2024 at 5:13 PM Cal Stephens @.***> wrote:

The attachment didn't come through from the email to the github issue UI.

— Reply to this email directly, view it on GitHub https://github.com/airbnb/lottie-ios/issues/2493#issuecomment-2429561992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS22DJYC7LRQDYOBO5LGYK3Z4ZTSTAVCNFSM6AAAAABQMLPQWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRZGU3DCOJZGI . You are receiving this because you authored the thread.Message ID: @.***>