[AC-2960] Android: remote images not loading as cache folder does not appear to exist
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-12-15T13:36:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, cache, defect, imageView, remote |
Reporter | kosso |
Assignee | Shak Hossain |
Created | 2011-12-15T13:03:47.000+0000 |
Updated | 2016-03-08T07:47:57.000+0000 |
Description
I've seen this crop up now and again: basically I have a table with images being loaded in the rows. Initially this was working. But when I've updated the app and tweaked some unrelated scripts, then go to totally remove the app from the device then re-install it, the remote images fail to load.
It appears the remote image cache folder is non-existent (any more):
/TiDownloadManager( 4451): (pool-2-thread-1) [65,7571] Exception downloading http://i.ytimg.com/vi/tCdUiL4FpLI/2.jpg
E/TiDownloadManager( 4451): java.io.FileNotFoundException: /mnt/sdcard/Android/data/com.amazingmedia.radio1/cache/_tmp/remote-cache/771b3e39cf992ed3f545043f43fff914ce8071ef.hdr (No such file or directory)
E/TiDownloadManager( 4451): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
E/TiDownloadManager( 4451): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
E/TiDownloadManager( 4451): at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
E/TiDownloadManager( 4451): at java.io.FileOutputStream.<init>(FileOutputStream.java:66)
E/TiDownloadManager( 4451): at java.io.FileWriter.<init>(FileWriter.java:42)
E/TiDownloadManager( 4451): at org.appcelerator.titanium.util.TiResponseCache.put(TiResponseCache.java:374)
E/TiDownloadManager( 4451): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.maybeCache(HttpURLConnectionImpl.java:331)
E/TiDownloadManager( 4451): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1043)
E/TiDownloadManager( 4451): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512)
E/TiDownloadManager( 4451): at java.net.URL.openStream(URL.java:645)
E/TiDownloadManager( 4451): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157)
E/TiDownloadManager( 4451): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
E/TiDownloadManager( 4451): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
E/TiDownloadManager( 4451): at java.lang.Thread.run(Thread.java:1019)
E/TiDownloadManager( 4451): (pool-2-thread-2) [48,7720] Exception downloading http://i.ytimg.com/vi/jk_Kmlj-U7A/2.jpg
E/TiDownloadManager( 4451): java.io.FileNotFoundException: /mnt/sdcard/Android/data/com.amazingmedia.radio1/cache/_tmp/remote-cache/aa30b9ef9b18afe0bb37ec514c85b8ec04a8f8c2.hdr (No such file or directory)
E/TiDownloadManager( 4451): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
E/TiDownloadManager( 4451): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
..etc...
The only way I seem to get this to work is to change the app id and rebuild and install (effectively a new app) - this is not possible, since my app is already in the Android Market, so the app id will need to be the same (com.amazingmedia.radio1) when I do the update. (Only the version code/number changes)
So, for some reason, it appears that the remote image cache folder is not being created.
If I (try to) navigate in the file manager on the device to /mnt/sdcard/Android/data/com.amazingmedia.radio1
it does not exist.
It now appears that clearing out the build folder and forcing a fresh rebuild actually fixed this. Very odd. I'm sure I'd tried that first! Sorry! Feel free to make as closed.
Hi Kosso I have improved the ticket as much as I can, to bring it in line with the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist), but there is still some missing information which is preventing me from moving it to TIMOB. Would you mind providing more details of the environment and your code (at least relating to the table)? Also, please remember to use the markup syntax provided, as it makes the ticket easier to understand. If you can do so soon, I can move it across tonight. Many thanks Paul
Kosso, do you really mean that
/mnt/sdcard/Android/data/com.amazingmedia.radio1
does not exist, or that/mnt/sdcard/Android/data/com.amazingmedia.radio/cache/
does not exist?See my first comment. It seems that forcing a rebuild by deleting the contents of build/android/* fixed this. I thought I'd tried this first. Then did it after submitting this ticket, after spending a few hours trying all sorts of solutions. That did it! ;) Sorry.
Don't worry - you can always reopen this if it does in fact seem to be a bug. Thanks for the update, mate! :)
I have the same problem and I resolved adding the permission WRITE_EXTERNAL_STORAGE to the AndroidManifest.xml.
Hello, We tested this issue recently and we were unable to reproduce this error wi TiSDK 3.2.0GA. Please check our test code and let us know if you notice any different results.
Test Environment
MAC OSX Version 10.9, Titanium SDK 3.2.0.GA Android SDK: 2.3.3 Android Device 4.2.2Test Code
Closing this since the issue is not reproducible with our latest versions of the TISDK. A functional sample has been posted for your reference.