Hi,
I am getting no image when I use loadRemoteImage() on an Android device. Works fine on the simulator though… I didnt have the params parameter initially but put in in later, same results. Any suggestions ?
Thx
Sanjit
local params = {}
params.headers = {}
params.headers[“Content-Type”] = “image/png”
params.headers[“User-Agent”] = “Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0”
params.headers[“Accept-Language”]= “en-US,en;q=0.5”
params.headers[“Accept-Encoding”] = “gzip, deflate”
display.loadRemoteImage(“https://graph.facebook.com/620112803/picture”, “GET”,
function(event)
local root = root
if ( event.isError ) then
print(“Remote image error”)
else
print(“Remote image ok”)
print(“RIMGG::”, event.target.contentWidth, event.target.contentHeight)
local pic = event.target
--pic.alpha = 0
--transition.to( pic, { alpha = 1 } )
fitImage(pic, ww, hh)
pic.x = xx
pic.y = yy
sceneGroup:insert(pic)
pic:toFront()
end
end,
params,
filename,
system.TemporaryDirectory,
xx,yy
)
11-10 23:20:57.734: E/Corona(6738): ERROR: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.734: W/System.err(6738): java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.734: E/Corona(6738): ERROR: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
11-10 23:20:57.734: W/System.err(6738): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
11-10 23:20:57.734: W/System.err(6738): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
11-10 23:20:57.734: W/System.err(6738): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
11-10 23:20:57.734: W/System.err(6738): at java.io.InputStream.read(InputStream.java:162)
11-10 23:20:57.734: W/System.err(6738): at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
11-10 23:20:57.734: W/System.err(6738): at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.Util.readAsciiLine(Util.java:316)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:308)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:135)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:644)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
11-10 23:20:57.734: W/System.err(6738): at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1394)
11-10 23:20:57.734: W/System.err(6738): at java.lang.Thread.run(Thread.java:841)
11-10 23:20:57.734: W/System.err(6738): Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.Posix.recvfromBytes(Native Method)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.Posix.recvfrom(Posix.java:141)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
11-10 23:20:57.734: W/System.err(6738): … 15 more
11-10 23:20:57.734: W/System.err(6738): java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
11-10 23:20:57.734: W/System.err(6738): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
11-10 23:20:57.734: W/System.err(6738): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
11-10 23:20:57.734: W/System.err(6738): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
11-10 23:20:57.734: W/System.err(6738): at java.io.InputStream.read(InputStream.java:162)
11-10 23:20:57.734: W/System.err(6738): at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
11-10 23:20:57.734: W/System.err(6738): at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.Util.readAsciiLine(Util.java:316)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:308)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:135)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:644)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
11-10 23:20:57.734: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
11-10 23:20:57.734: W/System.err(6738): at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1394)
11-10 23:20:57.734: W/System.err(6738): at java.lang.Thread.run(Thread.java:841)
11-10 23:20:57.734: W/System.err(6738): Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.Posix.recvfromBytes(Native Method)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.Posix.recvfrom(Posix.java:141)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
11-10 23:20:57.734: W/System.err(6738): at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
11-10 23:20:57.734: W/System.err(6738): … 15 more
11-10 23:20:57.774: E/Corona(6738): ERROR: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.774: W/System.err(6738): java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.774: W/System.err(6738): at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
11-10 23:20:57.774: W/System.err(6738): at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
11-10 23:20:57.774: W/System.err(6738): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
11-10 23:20:57.774: W/System.err(6738): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
11-10 23:20:57.774: W/System.err(6738): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
11-10 23:20:57.774: W/System.err(6738): at java.io.InputStream.read(InputStream.java:162)
11-10 23:20:57.774: W/System.err(6738): at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
11-10 23:20:57.774: W/System.err(6738): at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.Util.readAsciiLine(Util.java:316)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:308)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:135)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:644)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
11-10 23:20:57.774: W/System.err(6738): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
11-10 23:20:57.774: W/System.err(6738): at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1394)
11-10 23:20:57.784: W/System.err(6738): at java.lang.Thread.run(Thread.java:841)
11-10 23:20:57.784: W/System.err(6738): Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
11-10 23:20:57.784: W/System.err(6738): at libcore.io.Posix.recvfromBytes(Native Method)
11-10 23:20:57.784: W/System.err(6738): at libcore.io.Posix.recvfrom(Posix.java:141)
11-10 23:20:57.784: W/System.err(6738): at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
11-10 23:20:57.784: W/System.err(6738): at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
11-10 23:20:57.784: W/System.err(6738): … 15 more