iOS Crash caused by Countly Analytics integration
2025-04-30
At Arrillo we take great care to write stable and performant software, while some crashes are inevitable I was suprised to see one reported in the apple app store connect dashboard this morning.

Apple App Store Connect Graph showing an app crash occured
When loading up the crash in XCode, I was even more suprised when I found the source of the crash, was simply in reporting an error to Countly!

Screenshot of XCode showing the line crashing the app was Countly RecordError
To be fair, in the documentation it shows the correct syntax, which shows it should have provided Thread.callStackSymbols
as the stackTrace value.
Countly.sharedInstance().recordError("ERROR_NAME", stackTrace: Thread.callStackSymbols)
But how did this not get picked up by the type checking system? Well, it was our enemy Any
rearing his ugly head
![XCode documentation for Countly RecordError showing it takes [Any] as the value](/posts/countly-crashed-our-app/Countly_doc.jpeg)
XCode documentation for Countly RecordError showing it takes [Any] as the value
Having managed to avoid using Any
throughout our app development, it has been frustrating to get caught out by it in this package. It will be something to keep an eye out for in future code reviews.
The reason I wanted to write up this post was to highlight for anyone else that might have started using countly following our Open Source Analytics for Web & Mobile post.
Finally, I want to think about / research a method to identify any function calls in the code that accept parameters with Any
as potentially unsafe calls.