Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2607] Android: ImageView Fails When Loading Remote Image

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:59:35.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M05
ComponentsAndroid
Labelsandroid, defect, imageview, regression, release-1.6.0, reported-1.5.0, rplist
ReporterRyan Asleson
AssigneeDon Thorp
Created2011-04-15T03:24:32.000+0000
Updated2011-04-17T01:59:35.000+0000

Description

Hello,

After upgrading to the Titanium 1.5 and 1.5.1 SDK, my application can no longer load remote images via an ImageView on Android. It causes a force close. If I build with the previous 1.4.2 SDK the problem goes away, so I'm pretty sure it's a regression in the new SDK.

I built a test case that seems to demonstrate the problem. Use the attached app.js in a new project and deploy the attached image to a local server, then update line 34 in the attached app.js to use the URL to the image. When you run the project (I used the 2.3 emulator) it will fail sometime after it loads the image; if you use the 1.4.2 SDK it won't fail.

I hope the test case helps track down the issue. This is a show stopper for my application. Thank you so much for all the great work on Appcelerator Titanium!!

-Ryan

Attachments

FileDateSize
app.js2011-04-15T03:24:34.000+00002025
login-photo.jpg2011-04-15T03:24:34.000+000031931

Comments

  1. Ryan Asleson 2011-04-15

    It looks like other users are seeing it too:

    http://developer.appcelerator.com/question/91101/imageview-problem-after-upgrading-to-151"> http://developer.appcelerator.com/question/91101/imageview-problem-...

  2. Richard Brents 2011-04-15

    Not sure if this is the proper venue, but ...

    I reported a similar problem via the forums (http://developer.appcelerator.com/question/91101/imageview-problem-after-upgrading-to-151)">http://developer.appcelerator.com/question/91101/imageview-problem-.... Originally I thought my problem was the same as this ticket, but now I'm not so sure.

    For me, I can make the remote image fail every time if the phone (Android, 2.2) is plugged in via the USB port for either USB Mass Storage or Charge Only modes. But if the phone is plugged in via PC Mode or Windows Media Syne modes, the remote image load works flawlessly every time.

    So I'm not sure if this is really related or not - but I wanted to mention it ...

  3. Don Thorp 2011-04-15

    Updating state to reflect current status.

  4. Dawson Toth 2011-04-15

    Got a pro client asking for this fix as well.

    Simpler Sample Code

       var win = Ti.UI.createWindow({title: 'Broken Image on Android', backgroundColor: '#fff'});
       win.add(Titanium.UI.createImageView({
           top: 0, left: 0,
           height: 48, width: 320,
           canScale: true,
           image: 'http://ads.farmcentric.com/banners/1/2010/PioneerHBus_rgb_320x48.jpg'
       }));
       win.open();
       

    Tested On

    Titanium Mobile 1.6.0 pulled January 8th, 2011
    WORKS on iPhone Simulator 4.2
    BROKEN on Android Simulator 2.2

    Associated Helpdesk Ticket

    http://developer.appcelerator.com/helpdesk/view/64041">http://developer.appcelerator.com/helpdesk/view/64041

  5. Anthony Webb 2011-04-15

    This one is preventing me from taking my android app live. I'd also like to see this bug fixed soon if possible.

  6. hal 2011-04-15

    http://developer.appcelerator.com/question/99781/remote-images-not-loading-in-160-on-android-imageview"> This question in the Q&A confirms it's not working for 1.6.0, although user claims 1.5.1 works OK.

  7. Anthony Webb 2011-04-15

    Verified, working in 1.5.1, thanks for the tip hal.

  8. kevinwhinnery 2011-04-15

    request from two pro seats is to include this fix on the 1.5.x branch, but it looks like it might be there already? Should verify before closing ticket in any case.

  9. Don Thorp 2011-04-15

    (from [608046073c1c29c58a000397404c44897c4c7d17]) [#2607 state:fixed-in-qa] reworked background downloading to be less complex and to also correctly handle already cached images. https://github.com/appcelerator/titanium_mobile/commit/608046073c1c29c58a000397404c44897c4c7d17"> https://github.com/appcelerator/titanium_mobile/commit/608046073c1c...

  10. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/14/11 10:32 43fff62) g1 (1.6) droid1 (2.2.1) sim 2.1. as per Kevin, checked [INFO] Titanium SDK version: 1.5.2 (01/14/11 10:34 8e8e048) and saw no issue.

  11. Chris Brooks 2011-04-15

    Works FINE on HTC Desire on both 1.5.2 and 1.6.0 RC1

    HTC Desire HD:

    SDK 1.5.2
    Fatal Exception on HTC Desire HD (App closes and Error Closes) on loading remote image

    SDK 1.6.0 RC1
    No Exception but image does not load on HTC Desire HD on 1.6.0 (local images load ok)

  12. Chris Brooks 2011-04-15

    Further Information regarding Failure On HTC Desire HD Device:

    Titanium SDK:
    version=1.6.0
    timestamp=02/18/11 15:10
    githash=30eec59

    The following trace shows that the device cannot find the image. Perhaps the device is trying to find the URL locally ?

        I/TiAPI   (28702): (kroll$6: app://main.js) [2,376412] album URL: http://userserve-ak.last.fm/serve/300x300/43954033.jpg
        I/TiFileHlpr(28702): (main) [122,376534] http://userserve-ak.last.fm/serve/300x300/43954033.jpg not found.
        I/TiFileHlpr(28702): (main) [130,376664] http://userserve-ak.last.fm/serve/300x300/43954033.jpg not found.
        I/TiFileHlpr(28702): (main) [134,376798] http://userserve-ak.last.fm/serve/300x300/43954033.jpg not found.
        I/TiFileHlpr(28702): (main) [135,376933] http://userserve-ak.last.fm/serve/300x300/43954033.jpg not found.
        

    I have tested the above URL using the devices browser and it loads up there fine.

    It makes no difference how the device is connected to the internet, via Mobile Network or WiFi has the same result where the HTC Desire has no problem.

  13. Thomas Huelbert 2011-04-15

    Chris, it's best to report the issue you are encountering via helpdesk or Q&A. Thanks!

  14. Radhakrishnan 2011-04-15

    Is this Problem fixed? I am getting the same error. Please provide me a fix for that.

  15. krishnan 2011-04-15

    Is this Problem fixed? I am getting the same error. Please provide me a fix for that.

  16. Chris Brooks 2011-04-15

    In the 1.6.0 Release this is working for me. The issue with the HTC Desire HD I was having above was due to a dodgy SD Card, since the images are cached to the SD Card.

    Stating which version of Titanium SDK and android SDK you are using would be helpful!

  17. Chris Brooks 2011-04-15

    Also, Sorry I have to make another post because I cant edit my last post, like Thomas said to me its probably best to get support for your problem on the helpdesk, or there is a relevant ticket in the community Q&Ahttp://developer.appcelerator.com/question/99781/remote-images-not-loading-in-160-on-android-imageview" title="Here">here

JSON Source