rive-app / rive-ios

iOS runtime for Rive
MIT License
468 stars 53 forks source link

Pink rectangle after minimizing the application #233

Closed brianvar closed 1 year ago

brianvar commented 1 year ago

Description

Hello, I recently started using Rive, made an animation and integrated it into the application using rive-ios. I had no problems until I accidentally noticed this bug: when I minimize the application, the animated object turns into a pink rectangle. Riv file has two animations: for light and dark theme.

Provide a Repro

Piece of code: https://pastebin.com/Qtp1PsnC Video: https://imgur.com/a/vVq5dZ7

Source .riv/.rev file

I can provide it privately if needed

Expected behavior

The animation continues to display correctly

Screenshots

image

Device & Versions (please complete the following information)

Additional context

if you call onTapGesture (click on the animation) before minimizing the application, the chance of the animation turning pink is greatly reduced. After a click (probably a consequence of calling .play() the animation) I have only once seen this happen. However, I would like to point out that the problem also appears on the real device on a regular basis.

zplata commented 1 year ago

Hey @brianvar - thanks for reporting and sorry your an into this issue! Feel free to send the .rev file to https://rive-app.typeform.com/to/QdTi9zri so we can investigate a bit further

toniarr commented 1 year ago

@duncandoit I have the file. It's here in the ticket in HubSpot. I can send it to you in Slack as well.

duncandoit commented 1 year ago

I'm unable to repro this particular bug. I did notice in your code that you may want to change the way you handle the triggering of the different animations. Rather than creating two duplicate RiveViewModels for the same file you could use one viewmodel and just change the animation with the play func: .play(animationName: "animationDark")

I'd like to test something closer to your actual code. Are you able to share all or some of your project source?

brianvar commented 1 year ago

@duncandoit yes, I also tried with the Example application and didn't notice this bug.

I did as you said earlier, but using animation: colorScheme == .dark ? "animationDark" : "animationLight". I made a solution with two variables because I thought that for some unknown reason the animation was unloaded from memory.

Can we contact via Telegram or mail?

mjtalbot commented 1 year ago

Hi @brianvar, apologies for the radio silence on this, are you still experiencing this issue?

If you can share a repro of this issue with us that would be much appreciated, you can reach us via mail on support@rive.app

brianvar commented 1 year ago

@mjtalbot Hello! No, I created a new project and the problem disappeared using the same animation. I'm not quite sure what the problem was, maybe I did something wrong in the last project. Thank you for your response.

mjtalbot commented 1 year ago

Thanks for getting back on this one, I'm going to close the issue for now then, of course feel free to raise a new one if you experience this or other ones