[TIMOB-19647] iOS: ImageViews with remote images slow and failing
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-11-19T23:28:39.000+0000 |
Affected Version/s | Release 4.0.0, Release 5.0.1, Release 5.0.2, Release 5.0.0 |
Fix Version/s | Release 5.1.0, Release 5.2.0 |
Components | iOS |
Labels | ImageView, Images |
Reporter | Uriel Lizama |
Assignee | Hans Knöchel |
Created | 2015-07-09T02:31:31.000+0000 |
Updated | 2016-01-20T21:38:41.000+0000 |
Description
This issue has been happening since version 4.0. I have a ListView with infinite scrolling that display a thumbnail loaded remotely for each thumbnail. The loading of the images is really slow, and sometimes they fail without error and will not load.
This doesn't happen on SDK 3.5.1, which has all images loading correctly and at the expected speed based on my network speed an image size.
I can confirm that issue is still present on 5.0.0.GA
+1, noticed this when updating from 3.5.1
Can someone add timing information that shows the difference in speed?
The issue is very very noticeable. I created a couple of comparison videos, one with an app running SDK 3.5.1.GA and the other one using the latest 5.0.0.GA. The difference is obvious, and on the latest SDKs image loading has become unusable almost. I tried to stay on 3.5.1 as long as possible just because of this, but now I don't have another choice, so I'm hoping we can fix this. *SDK 3.5.1 Image Loading* https://drive.google.com/file/d/0B8nGzMS1NSFwZi1aaldiWnladjA/view?usp=sharing *SDK 5.0.0 Image Loading* https://drive.google.com/file/d/0B8nGzMS1NSFwT2VhUFhtbm1SVFE/view?usp=sharing
+1, did not notice it directly. But now I've been experimenting myself as well with 3.5.1 versus 4.0.0 and up and see the difference.
I think this issue has to be set as top priority. The fact that apps can't reliably fetch remote images is a big issue. This gives a negative impact on any app built with any SDK newer than 3.5.1 and it translates into a poor user experience.
I have created a new issue with ListViews and XCode 7 which may relate to this, it would be good to know if my use case applies here. Please see: AC-438
Tentatively slating for next major release.
Glad to see this being moved forward. I do believe case AC-438 relates to this, as I've seen this change of behaviour as well.
[~ulizama] Can you please provide a simplified demo code to reproduce your issue? We did some internal tests and could not reproduce the issue, yet. Also make sure you have disabled the iOS9 "App Transport Security" as documented here: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network Thank you!
I will check on the Transport Security thing and see if it changes anything, and I'll post a test code, though it will a simple ListView loading rows with image thumbnails on them.
Please guys fix this error, on iOS the image loading experience is very bad using the 4.x or 5.x versions of Titanium SDK.
[~juanblo] Can you provide a simplified demo as [~hansknoechel] requested?
I created a simple test app. Is just a listview with inifnite scroll that fetches results from an API: https://drive.google.com/file/d/0B-oU9c3d4Cn5bEZMTjRiaHlPNDg/view?usp=sharing I have been doing more tests, and the issue is more noticeable on the device itself. To test, run the app and paginate quickly so you have 20-30 images loading at a time.
We worked in the issue the last days and fixed it just today. We will continue testing and provide a solution asap.
We Updated the SDK, which should fix the delay when loading the images. I've added a dropbox link with the SDK, could you please test it and see if the problem still persists? Thank you! https://www.dropbox.com/s/51y3lca28wropza/mobilesdk-5.2.0-osx.zip?dl=0 P.S.: We can include this change into the upcoming 5.1.0 release, if we get a response this week.
Downloaded the SDK. Image loading is faster, but I'm encountering app crashes:
Hi, sorry to see you're getting errors. Do these error's consist with the current master version of our SDK if you was to build the same project or is it only on 5.2.0 SDK that i sent.
So, I had been testing my app with 5.0.1.GA and haven't seen that error so far. The error did come up rather quickly in the version you sent: 5.2
Hmm that's weird , could you send us the app your testing. So we can run it on 5.2 as well , to see if i encounter the same errors and if so ill try my best to fix them. Could you also test your app with the newest build (http://builds.appcelerator.com.s3.amazonaws.com/index.html#5_1_X) to see if the app crashes? It does not include the changes for now, but so we could see if the crash is related to the fix or a different issue. Also, please and send us the trace logs.
I've downloaded the SDK (5.2) and for me the fix works fine. My environment: * Mac OSX 10.10.4 * Appcelerator Command-Line Interface, version 5.0.3 * Alloy 1.7.16 * Xcode 7.0.1 (build 7A1001) * Node.js Version 0.10.29 * npm Version 1.4.18 * Titanium CLI Version 5.0.5 * node-appc Version 0.2.31
Thanks for your work on this guys, I can confirm that it has also fixed my issue at AC-438. I am getting a lot of indiscriminate app crashes, with no obvious error, but these also occur with the latest 5.1.x nightly build, so i assume they are unrelated.
[~juanblo] Thanks for verifying! [~ulizama] [~martz256] Can you provide a trace log to reproduce the crash? We want to make sure, that the fix does not affect the stability of other components.
Is possible include this fix in the next release of SDK ?
I don't get any crashes / errors when using the demo app that i created to test this issue, all works fine. My main app crashes on device only using both the nightly of 5.1.x and 5.2.0 that you sent over. I have a lot going on in that app and so cannot currently pin down where the issue is. I do not get any trace errors, the app just quits. I have a crash log from my phone at the following link, although im not sure how much help it will be. https://dl.dropboxusercontent.com/u/24724357/Scredible%20%2016-10-2015%2014-49.crash Thanks, Martyn
Hey guys, I downloaded mobilesdk-5.1.0.v20151014101225 and tested the app with that SDK. And the crash doesn't occur. I then cleaned and built with the 5.2 and the crash happened again. There is no TRACE data, just this:
Some things I noticed: 1. The crash happens randomly, but it seems to happen whenever I start a new http request to load more items on the infinite scroll. 2. The http request to load more items, seems to be blocked until all the previous images have been loaded, I don't know if this is the intended behaviour, but I would assume that http requests should take precedence on loading the images. Thanks for your all help.
Hi everyone! We discussed the solution internally. First of all, the crashes above don't look like being related to the list view change, so please file tickets, if you can define a component, that causes the crash. Regarding the list view remote images, we will not change the default behavior, but introduce a new property
lazyLoadingEnabled
which istrue
by default. That means, that images are loaded as soon as they come into the visible area like it is now. If you want to load images even if they are not in the visible area (which reflects the fix we provided above), you can then setlazyLoadingEnabled
tofalse
. Is everyone good with this solution? We would then get it into the upcoming 5.1 SDK release. Feedback appreciated! P.S.: The property will be available forTi.UI.ListView
on iOS.Thank you very so much Hans for this fix. From my point of view this solution is right. To testing what version (or branch) of SDK can we use ?
Thanks! I really like that solution ;)
Thanks, thats a great solution! Getting it into 5.1 is also a massive thumbs up!
I experienced this wrong behaviour as well, here's my thoughts. I have a
TableView
, in eachTableViewRow
I have aImageView
that loads an image from a url. The app crashes with *nothing in logs*. Here what I discovered after some investigation: * The issue happens with SDK 4.x.GA and 5.0.x.GA. On 5.2.0 still happens, but less frequently. * As far as I understood, the issue is somewhat related to the delay for downloading the image. Thus is more frequent when using a 3g connection instead of WiFi, or when the image is slightly bigger. Anyway, the sample app provided from Uriel Lizama works fine for me with all the previous sdk. I hope this few thoughts can helpAfter some further investigation, I came out with a crash log from my device. Here an excerpt: {panel} OS Version: iOS 8.1.3 (12B466) Report Version: 105 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000c Triggered by Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x3209ef46 objc_msgSend + 6 1 XXXYYYZZZ 0x0020a158 +[TiLayoutQueue layoutProxy:] (TiLayoutQueue.m:78) 2 XXXYYYZZZ 0x00209fb8 performLayoutRefresh (TiLayoutQueue.m:46) 3 CoreFoundation 0x2485ec84 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12 4 CoreFoundation 0x2485e7fe __CFRunLoopDoTimer + 646 5 CoreFoundation 0x2485ca4e __CFRunLoopRun + 1414 6 CoreFoundation 0x247aa3bc CFRunLoopRunSpecific + 472 7 CoreFoundation 0x247aa1ce CFRunLoopRunInMode + 102 8 GraphicsServices 0x2bba80a4 GSEventRunModal + 132 9 UIKit 0x27db87ac UIApplicationMain + 1436 10 XXXYYYZZZ 0x0008603e main (main.m:37) 11 libdyld.dylib 0x32612aac start + 0 Thread 0 crashed with ARM Thread State (32-bit): r0: 0x1541ac00 r1: 0x00534c87 r2: 0x1541ac00 r3: 0x3209ef41 r4: 0x00000020 r5: 0x007d5bf4 r6: 0x007d5c80 r7: 0x007d5b98 r8: 0x34d94074 r9: 0x00000000 r10: 0x14e845a0 r11: 0x14d47a50 ip: 0x0020a131 sp: 0x007d5b84 lr: 0x0020a15b pc: 0x3209ef46 cpsr: 0x600f0030 {panel} (XXXYYYZZZ is my app)
PR (master): https://github.com/appcelerator/titanium_mobile/pull/7320 PR (5_1_X): https://github.com/appcelerator/titanium_mobile/pull/7329
wow what I improvement, just tested. Thanks.
FYI I found the cause of my crashes to be TIMOB-19682 javascript executing on the main thread, this was fixed following the notes here: https://github.com/appcelerator/titanium_mobile/pull/6891 I hope this will help others who are having issues. This ListView update is working perfectly, thanks
Verified fixed, using: MacOS 10.11.2 (15C27e) Studio 4.4.0.201510280736 Ti SDK 5.1.0.v20151028190028 Appc NPM 4.2.1 Appc CLI 5.1.0-38 Ti CLI 5.0.5 Alloy 1.7.16 Arrow 1.3.13 Xcode 7.2 (7C46l) Node v0.12.7 Java 1.7.0_80 production Used the sample code to test load times/errors on remote images, with lazyLoadingEnabled set to true and false. Loading was very responsive and the new property works as intended.