-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash while loading images in iOS 10 #1367
Comments
Thanks for the report. I will check it soon later! |
Cannot reproduce it in the sample app, at least with the latest 5.11.0. Not sure why it can crash on iOS 10. Are you trying to set a very large Or, could you please try to upgrade to the latest version and check whether this crash is still there? Thanks. |
I'm using a customer support SDK that it using kingfisher to load attachment images. I have also opened a ticket on their github profile but they were also not able to reproduce the error. So unfortunately I can't update to a newer version directly. First I thought the crash was happening as I was also importing kingfisher as a podfile (as I was also using it to load images). I then removed it, now it only gets imported from their sdk. But the crash still occurs. It doesn't matter if images are being loaded in my code or being loaded under their view controller. The crash occurs as soon as there is an image loading process. Weirdly enough everything works fine on iOS 13. I know this doesn't directly correspond as a bug on your end maybe they are doing something wrong but at this point we're stuck with their sdk and they haven't been much helpful about this. I am attaching a link to their repository maybe you can see if they're using it incorrectly somewhere. Also I found that in their code, they are using the following value for storage expiration
Link to the page containing the above code snippet, Thank you so much for your help so far. |
Thanks for the feedback. It is not related to the iOS system version, but due to the 32-bit int on old devices. :( I fixed it in the PR above and will schedule a release for it soon. However, it is not quite possible to release a patch for 5.7.x for it. I strongly suggest they also upgrade it, or temporarily set a shorter cache duration. |
Although they wrote: //Image cache expiration after one day
ImageCache.default.diskStorage.config.expiration = StorageExpiration.days(86400) But the cache is not one day, it is now 236 years. |
That makes a lot of sense now, at-least we now know why its happening. For the time being, is it somehow possible that I can modify the code that is causing the crash on 32-bit devices? Would it help with the crash if I set a shorter expiration date? |
Sure, you can just check my code in #1371 to have a fix. Or you can just overwrite the |
Ok thank you, I'll try out setting the expiration time and will get back to you. Thank you so much for your help. |
5.12.0 was released in a fix for this was contained. |
I am getting the following exception whenever I try to load an image through a given url. This only happens in iOS 10. In iOS 13 there's no exception and the image loads perfectly fine.
The exception occurs at the case.days line
SDK version is v.5.7.0.
The text was updated successfully, but these errors were encountered: