Open Vaibhav2002 opened 3 months ago
Any animation example / xcode profiling info? What is causing the ANR? Memory? Cpu? Do you have multiple animations from the same json file on screen at the same time? Have you tested the release build? Can you try the sample app? There is also a lazy grid of various animations and nothing hangs for me
Android works pretty good with no such hangs
The code is 99% shared so it can be a Compose issue
Yes, i have multiple animations from same json running in the same screen Some lazy column items have the same animation
This is only happening in release build, I never encountered this when running app on debug builds or in simulator I am using this on production, and its hanging in a lot of devices
Few animations which i am using:
Try to disable composition cache with rememberLottieComposition(key = null)
It's hard to tell anything concrete without a reproducer. Are there specific devices it hangs on? Old low-memory iphones? Is you app open source?
Making a reproducer is difficult, as it just happens even with a simple lazy column It hangs even on latest iPhone 15, 14 devices
App is not open source.
The composable i shared above, is how i use it everywhere.
I'll try with disabling composition cache and update here
@alexzhirkevich It still crashes Even after disabling composition cache
I managed to get some Crash logs, maybe that might help Medial-2024-08-05-171516.txt Medial-2024-08-05-171238.txt Medial-2024-08-05-171430.txt
@alexzhirkevich Any update on this? Facing the same issue
Do you have a reproducer?
Its completely random. I am using it as in the Read me
Any relevant stacktrace? Profiling info? Memory dump?
It's the same crash logs as @Vaibhav2002
This logs only says that the app was terminated due to exceeding the backround work quota. What compose and kotlin version do you use?
Compose 1.6.11 Kotlin 2.0.0
Any special usages? Maybe this happen when you use lotties with images or with dynamic properties?
Yes dynamic properties are used for light and dark switch Yes we use lottie with images but it works fine in Android Also the animation is in cells of lazy column
Can you try it without dynamic properties and then without images? It will help to find the root cause
May be improved in 2.0.0-rc01
@alexzhirkevich What was the cause? Sorry we had to revert since on production iOS users were reporting a lot of crashes
There just was some refactoring in terms of synchronisation and simultaneous composition running. I can't be sure it is fixed completely since there is no reproducer. You can try it in non-prod env
@Vaibhav2002 @LaatonWalaBhoot Is the issue fixed for you on iOS with latest versions?
@sahilbajaj Seems like the issues have subsided for now. But unfortunately this observation is purely anecdotal Would need some more time to be more objective
Thanks @LaatonWalaBhoot
@alexzhirkevich I just experienced a crash here as well. Repeatedly displaying and then closing the Lottie animation causes a crash. The crash occurs in the class io/github/alexzhirkevich/compottie/internal/shapes/TransformShape.kt. Could this issue be due to deep copying? TransformShape.kt Line 86
Crash Details:
SIGSEGV
SEGV_ACCERR
0 libobjc.A.dylib _objc_release_x8 + 16
5 AVFCore 0x00000001b3c04000 + 43256
6 优课UOOC __cxa_throw + 23215540
7 优课UOOC __cxa_throw + 23312100
8 优课UOOC __cxa_throw + 8076556
9 优课UOOC __cxa_throw + 8065980
10 优课UOOC __cxa_throw + 9556604
11 优课UOOC __cxa_throw + 9699200
12 优课UOOC __cxa_throw + 57555400
13 libdispatch.dylib __dispatch_call_block_and_release + 32
23 UIKitCore _block_destroy_helper.23 + 10212
24 优课UOOC 0x00000001024a4000 + 33648
25 dyld 0x00000001c7855000 + 212276
Address Calculation:
python3 -c "print(hex(0x00000001024a4000 + 33648))"
# Result: 0x1024ac370
Symbolicated Output:
vickyleu@vickydeMac-mini dSYMs % atos -o "优课UOOC.app.dSYM/Contents/Resources/DWARF/优课UOOC" -arch arm64 0x1024ac370
# Result: kfun:io.github.alexzhirkevich.compottie.internal.shapes.annotationImpl$kotlinx_serialization_json_JsonClassDiscriminator$0.equals#internal.958 (in 优课UOOC) (TransformShape.kt:1)
@vickyleu Thanks for detailed crash log. Seems like the issue is somewhere in generated serializer descriptor. Does it happen for all animations or for some specific? And does it always happen in the TransformShape? Is only the iOS version affected? Maybe you can share the animation? If you want you can mail it to me
We're currently using only one Lottie animation, and the crash is triggered very rarely. I clicked for an entire afternoon and it only happened once. Out of approximately 400 phased-release users, about 7 to 10, only ios, compottie rc-02
@alexzhirkevich I have sent the email attachment
What happened?
iOS App hangs very frequently when scrolling lists, swiping pager, selecting bottom nav items if there are lottie animations in the UI Like in every 2-3min while just scrolling a vertical lazy list or switching pager, iOS App completely hangs and user has to close the app and re-open it
Reason why I feel its due to Compottie
I replaced every lottie animation in app with a blank
Box
composable and even after hours of scrolling, swiping pages, doing all kind of interactions, app did not hang at allTested this for 2 days, and there has not been a single hang While as soon as i uncomment the Compottie code, the frequent app hangs starts again
This is degrading User Experience a lot.
This is only happening on iOS, Android works pretty good with no such hangs
Composable code
Unsupported features
What Compottie version do you experience the bug on?
2.0.0-beta02
What platforms are you seeing the problem on?
iOS
Does Compottie log anythyng to the stdout / your logger set with
Compottie.logger
?