Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: Release 5.1.0, Release 5.1.2, Release 5.1.1
    • Fix Version/s: Release 5.2.0
    • Component/s: Android
    • Labels:
    • Environment:

      SDK: 5.1.0.v20151104073721
      CLI: 5.0.5
      Node: 4.1.0
      npm: 2.14.3
      Classic Titanium, No Studio

    • Sprint:
      2016 Sprint 3 SDK

      Description

      Android 6 doesn't load images from a remote url, while Android 5 works fine. All of the following 4 are not shown on Android 6.

      var win = Ti.UI.createWindow();
       
      var view = Ti.UI.createScrollView({
      	scrollType: 'vertical',
      	layout: 'vertical'
      });
       
      view.add(Ti.UI.createLabel({
      	text: 'Remote HTTPS from AppC'
      }));
      view.add(Ti.UI.createImageView({
      	image: 'https://www.appcelerator.com/wp-content/themes/appc-rwd/assets/media/images/logo.png'
      }));
       
      view.add(Ti.UI.createLabel({
      	text: 'Remote HTTP from AppC'
      }));
      view.add(Ti.UI.createImageView({
      	image: 'http://www.appcelerator.com/wp-content/themes/appc-rwd/assets/media/images/logo.png'
      }));
       
      view.add(Ti.UI.createLabel({
      	text: 'Remote HTTPS from CloudFront'
      }));
      view.add(Ti.UI.createImageView({
      	image: 'https://cfimagesstaging.zipwire.com/56325c2e7dec0.jpg'
      }));
       
      view.add(Ti.UI.createLabel({
      	text: 'Remote HTTP from CloudFront'
      }));
      view.add(Ti.UI.createImageView({
      	image: 'http://cfimagesstaging.zipwire.com/56325c2e7dec0.jpg'
      }));
       
      win.add(view);
      win.open();
      

      adb logcat shows a failing TiDownloader request:

      11-05 16:26:13.015 23434 23480 E TiDownloadManager: (pool-2-thread-1) [100607,100607] Exception downloading https://cfimagesstaging.zipwire.com/56325c2e7dec0.jpg
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.zipwire.test/cache/_tmp/remote-cache/5b7624468b64d5e3153101a30a50891c94dace39.hdr: open failed: ENOENT (No such file or directory)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at libcore.io.IoBridge.open(IoBridge.java:452)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.io.FileWriter.<init>(FileWriter.java:42)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at org.appcelerator.titanium.util.TiResponseCache.put(TiResponseCache.java:472)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.huc.CacheAdapter.put(CacheAdapter.java:57)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.http.HttpEngine.maybeCache(HttpEngine.java:554)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:826)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:439)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:231)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.net.URL.openStream(URL.java:470)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:135)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at java.lang.Thread.run(Thread.java:818)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at libcore.io.Posix.open(Native Method)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	at libcore.io.IoBridge.open(IoBridge.java:438)
      11-05 16:26:13.015 23434 23480 E TiDownloadManager: 	... 17 more
      

      I searched and found this Java issue:

      http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4620571

      It seems like Java can't handle a protocol redirect. I am just checking if we do this for images.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                msamah Ashraf Abu (Inactive)
                Reporter:
                janruehling Jan Ruehling
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20625
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code