[TIMOB-20200] Android 6.0 - Remote images are not rendered when using with Ti.UI.createImageView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-08-30T02:17:13.000+0000 |
Affected Version/s | Release 5.1.2, Release 5.1.1 |
Fix Version/s | n/a |
Components | Android |
Labels | qe-5.1.2, qe-6.2.0 |
Reporter | Wilson Luu |
Assignee | Unknown |
Created | 2016-01-06T00:24:48.000+0000 |
Updated | 2018-08-30T02:17:13.000+0000 |
Description
*Details:* Remote images are not rendered when using with Ti.UI.createImageView on a Android 6.0 device.
*Notes:*
* This is *not a regression* with 5.1.1.GA SDK.
* Remote images are rendered on Android 4.X devices.
*Steps to reproduce:*
Create a Titanium classic app
Replace app.js with the following code:
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var imageTest = Titanium.UI.createImageView({
image: 'http://chart.apis.google.com/chart?cht=r&chs=200x200&chd=t:77,66,15,0,31,48,100,77%7C20,36,100,2,0,100&chco=FF0000,FF9900&chls=2.0,4.0,0.0%7C2.0,4.0,0.0&chxt=x&chxl=0:%7C0%7C45%7C90%7C135%7C180%7C225%7C270%7C315&chxr=0,0.0,360.0',
// image: 'http://www.appcelerator.com/wp-content/themes/appc-rwd/assets/media/images/logo.png',
top: 10,
width: Ti.UI.SIZE,
height: Ti.UI.SIZE
});
win.add(imageTest);
win.open();
Install app to a 6.0 Android device.
*Actual:* In logcat, you will *intermittently* get this FileNotFoundException:
01-05 15:24:10.915: E/TiDownloadManager(13365): (pool-3-thread-2) [5309,5309] Exception downloading http://chart.apis.google.com/chart?cht=r&chs=200x200&chd=t%3A77%2C66%2C15%2C0%2C31%2C48%2C100%2C77%7C20%2C36%2C100%2C2%2C0%2C100&chco=FF0000%2CFF9900&chls=2.0%2C4.0%2C0.0%7C2.0%2C4.0%2C0.0&chxt=x&chxl=0%3A%7C0%7C45%7C90%7C135%7C180%7C225%7C270%7C315&chxr=0%2C0.0%2C360.0
01-05 15:24:10.915: E/TiDownloadManager(13365): java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.appcelerator.ImageView/cache/_tmp/remote-cache/9c7e4d9a7222251ad1e827727032e06efb597abb.hdr: open failed: ENOENT (No such file or directory)
01-05 15:24:10.915: E/TiDownloadManager(13365): at libcore.io.IoBridge.open(IoBridge.java:452)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.io.FileWriter.<init>(FileWriter.java:42)
01-05 15:24:10.915: E/TiDownloadManager(13365): at org.appcelerator.titanium.util.TiResponseCache.put(TiResponseCache.java:472)
01-05 15:24:10.915: E/TiDownloadManager(13365): at com.android.okhttp.internal.huc.CacheAdapter.put(CacheAdapter.java:57)
01-05 15:24:10.915: E/TiDownloadManager(13365): at com.android.okhttp.internal.http.HttpEngine.maybeCache(HttpEngine.java:554)
01-05 15:24:10.915: E/TiDownloadManager(13365): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:826)
01-05 15:24:10.915: E/TiDownloadManager(13365): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:439)
01-05 15:24:10.915: E/TiDownloadManager(13365): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384)
01-05 15:24:10.915: E/TiDownloadManager(13365): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:231)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.net.URL.openStream(URL.java:470)
01-05 15:24:10.915: E/TiDownloadManager(13365): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:135)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
01-05 15:24:10.915: E/TiDownloadManager(13365): at java.lang.Thread.run(Thread.java:818)
01-05 15:24:10.915: E/TiDownloadManager(13365): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
01-05 15:24:10.915: E/TiDownloadManager(13365): at libcore.io.Posix.open(Native Method)
01-05 15:24:10.915: E/TiDownloadManager(13365): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
01-05 15:24:10.915: E/TiDownloadManager(13365): at libcore.io.IoBridge.open(IoBridge.java:438)
01-05 15:24:10.915: E/TiDownloadManager(13365): ... 15 more
And, the remote image will not be rendered; see 6.0_device.png attachment.
*Expected:* You should see the remote image being rendered on device; see 4.X_device.png attachment.
Attachments
File | Date | Size |
---|---|---|
4.X_device.png | 2016-01-06T00:24:24.000+0000 | 25234 |
6.0_device.png | 2016-01-06T00:24:24.000+0000 | 37594 |
I believe there is an existing ticket already open for this plague. It relates to the write_external permissions being missing under android 6, unless you have prompted the user for camera/file storage perms.
This was fixed in Titanium 7.1.0 by this ticket: [TIMOB-25507] Caused by lack of external storage permission.