Project: titanium
Issue TIMOB-2653: Android: Complex/autogenerated remote image URLs fail, whereas simple URLs succeed
h2. Problem A complex url to an image, used in an imageView do not render. The issues is not present in 1.4.3 (21Nov). h2. Test case The following code will cause an exception: {code:lang=javascript|title=app.js} var window = Titanium.UI.createWindow({ backgroundColor:'red' }); var graph = Titanium.UI.createImageView({ top: 20, image: 'http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150' // image: 'http://developer.appcelerator.com/assets/img/sprites.png' }); window.add(graph); window.open(); {code} When the commented/uncommented image lines are toggled, the app works without a problem. h2. Logs {code:lang=none|title=logcat} 449 AndroidRuntime D >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 449 AndroidRuntime D CheckJNI is ON 449 AndroidRuntime D --- registering native functions --- 60 ActivityManager I Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.appcelerator.testing10/.Testing10Activity } 60 ActivityManager I Start proc com.appcelerator.testing10 for activity com.appcelerator.testing10/.Testing10Activity: pid=455 uid=10041 gids={1015, 3003} 449 AndroidRuntime D Shutting down VM 455 TiApplication I (main) [0,0] checkpoint, app created. 455 TiApplication I (main) [402,402] Titanium 1.8.1 (2012/01/27 17:31 a24502a) 455 TiFastDev D (main) [110,512] Enabling Fastdev on port 51023 455 TiFastDev D (main) [8,520] sent tokens successfully 455 TiFastDev D (main) [1,521] Fastdev session handshake succesful. 455 TiApplication I (main) [4,525] Titanium Javascript runtime: v8 455 TiApplication W (main) [47,572] activity stack is emtpy, unable to get current activity 455 TiRootActivity I (main) [0,0] checkpoint, on root activity create, savedInstanceState: null 455 TiApplication W (main) [116,116] activity stack is emtpy, unable to get current activity 455 TiApplication W (main) [1,117] activity stack is emtpy, unable to get current activity 455 TiApplication W (main) [0,117] activity stack is emtpy, unable to get current activity 60 NotificationService W Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@4500b128 in package com.appcelerator.testing10 60 ActivityManager W setProcessForeground called on unknown pid: 427 455 TiApplication E (KrollRuntimeThread) [1083,1200] APP PROXY: ti.modules.titanium.app.AppModule@44fccf38 455 TiAssetHelper D Fetching "app.js" with Fastdev... 455 TiUIImageView E (main) [524,1724] URISyntaxException for url http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc |def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiUIImageView E java.net.URISyntaxException: Illegal character in query at index 122: http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15, 12,10,26&chdl=xyz|abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiUIImageView E java.net.URI$Helper.validateQuery(URI.java:458) 455 TiUIImageView E java.net.URI$Helper.parseURI(URI.java:360) 455 TiUIImageView E java.net.URI$Helper.access$100(URI.java:302) 455 TiUIImageView E java.net.URI.(URI.java:87) 455 TiUIImageView E ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:715) 455 TiUIImageView E ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:849) 455 TiUIImageView E org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) 455 TiUIImageView E org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) 455 TiUIImageView E org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) 455 TiUIImageView E org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) 455 TiUIImageView E org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) 455 TiUIImageView E org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) 455 TiUIImageView E android.os.Handler.dispatchMessage(Handler.java:95) 455 TiUIImageView E org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318) 455 TiUIImageView E org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303) 455 TiUIImageView E org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188) 455 TiUIImageView E org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215) 455 TiUIImageView E org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143) 455 TiUIImageView E org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417) 455 TiUIImageView E org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:344) 455 TiUIImageView E org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:117) 455 TiUIImageView E org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:46) 455 TiUIImageView E android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 455 TiUIImageView E android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 455 TiUIImageView E android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 455 TiUIImageView E android.app.ActivityThread.access$2300(ActivityThread.java:125) 455 TiUIImageView E android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 455 TiUIImageView E android.os.Handler.dispatchMessage(Handler.java:99) 455 TiUIImageView E android.os.Looper.loop(Looper.java:123) 455 TiUIImageView E android.app.ActivityThread.main(ActivityThread.java:4627) 455 TiUIImageView E java.lang.reflect.Method.invokeNative(Native Method) 455 TiUIImageView E java.lang.reflect.Method.invoke(Method.java:521) 455 TiUIImageView E com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 455 TiUIImageView E com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 455 TiUIImageView E dalvik.system.NativeStart.main(Native Method) 455 TiDrawableReference E (main) [123,1847] Problem opening stream with url http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xy z|abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150: http://chart.apis.google.com/chart?chco=666666,555555,444444,3333 33,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiDrawableReference E java.io.FileNotFoundException: http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc|def|ghi|jkl&a mp;chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiDrawableReference E org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162) 455 TiDrawableReference E java.net.URL.openStream(URL.java:653) 455 TiDrawableReference E org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:172) 455 TiDrawableReference E org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:671) 455 TiDrawableReference E org.appcelerator.titanium.view.TiDrawableReference.peekBounds(TiDrawableReference.java:628) 455 TiDrawableReference E org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:461) 455 TiDrawableReference E ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:724) 455 TiDrawableReference E ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:849) 455 TiDrawableReference E org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) 455 TiDrawableReference E android.os.Handler.dispatchMessage(Handler.java:95) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143) 455 TiDrawableReference E org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417) 455 TiDrawableReference E org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:344) 455 TiDrawableReference E org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:117) 455 TiDrawableReference E org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:46) 455 TiDrawableReference E android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 455 TiDrawableReference E android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 455 TiDrawableReference E android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 455 TiDrawableReference E android.app.ActivityThread.access$2300(ActivityThread.java:125) 455 TiDrawableReference E android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 455 TiDrawableReference E android.os.Handler.dispatchMessage(Handler.java:99) 455 TiDrawableReference E android.os.Looper.loop(Looper.java:123) 455 TiDrawableReference E android.app.ActivityThread.main(ActivityThread.java:4627) 455 TiDrawableReference E java.lang.reflect.Method.invokeNative(Native Method) 455 TiDrawableReference E java.lang.reflect.Method.invoke(Method.java:521) 455 TiDrawableReference E com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 455 TiDrawableReference E com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 455 TiDrawableReference E dalvik.system.NativeStart.main(Native Method) 455 TiDrawableReference W (main) [54,1901] Could not open stream for drawable, therefore bounds checking could not be completed 455 TiDrawableReference W (main) [5,1906] Bitmap bounds could not be determined. If bitmap is loaded, it won't be scaled. 455 TiDrawableReference E (main) [95,2001] Problem opening stream with url http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz |abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150: http://chart.apis.google.com/chart?chco=666666,555555,444444,33333 3,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiDrawableReference E java.io.FileNotFoundException: http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc|def|ghi|jkl&a mp;chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiDrawableReference E org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162) 455 TiDrawableReference E java.net.URL.openStream(URL.java:653) 455 TiDrawableReference E org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:172) 455 TiDrawableReference E org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:671) 455 TiDrawableReference E org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:238) 455 TiDrawableReference E org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:467) 455 TiDrawableReference E ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:724) 455 TiDrawableReference E ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:849) 455 TiDrawableReference E org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:464) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:456) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:434) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:538) 455 TiDrawableReference E org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:271) 455 TiDrawableReference E android.os.Handler.dispatchMessage(Handler.java:95) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215) 455 TiDrawableReference E org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143) 455 TiDrawableReference E org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417) 455 TiDrawableReference E org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:344) 455 TiDrawableReference E org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:117) 455 TiDrawableReference E org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:46) 455 TiDrawableReference E android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 455 TiDrawableReference E android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 455 TiDrawableReference E android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 455 TiDrawableReference E android.app.ActivityThread.access$2300(ActivityThread.java:125) 455 TiDrawableReference E android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 455 TiDrawableReference E android.os.Handler.dispatchMessage(Handler.java:99) 455 TiDrawableReference E android.os.Looper.loop(Looper.java:123) 455 TiDrawableReference E android.app.ActivityThread.main(ActivityThread.java:4627) 455 TiDrawableReference E java.lang.reflect.Method.invokeNative(Native Method) 455 TiDrawableReference E java.lang.reflect.Method.invoke(Method.java:521) 455 TiDrawableReference E com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 455 TiDrawableReference E com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 455 TiDrawableReference E dalvik.system.NativeStart.main(Native Method) 455 TiDrawableReference W (main) [12,2013] Could not open stream to get bitmap 455 TiRootActivity I (main) [0,0] checkpoint, on root activity resume. activity = com.appcelerator.testing10.Testing10Activity@44f7a570 60 ActivityManager I Displayed activity com.appcelerator.testing10/.Testing10Activity: 3686 ms (total 3686 ms) 455 TiUIImageView D (main) [398,398] Retrying bitmap decode: 1/5 455 TiUIImageView E (main) [1,399] URISyntaxException for url http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15,12,10,26&chdl=xyz|abc|de f|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiUIImageView E java.net.URISyntaxException: Illegal character in query at index 122: http://chart.apis.google.com/chart?chco=666666,555555,444444,333333,222222&cht=p&chd=t:36,15, 12,10,26&chdl=xyz|abc|def|ghi|jkl&chdlp=b&chf=c,s,ffffff|bg,s,ffffff&chl=36%|15%|12%|10%|26%&chs=288x150 455 TiUIImageView E java.net.URI$Helper.validateQuery(URI.java:458) 455 TiUIImageView E java.net.URI$Helper.parseURI(URI.java:360) 455 TiUIImageView E java.net.URI$Helper.access$100(URI.java:302) 455 TiUIImageView E java.net.URI.(URI.java:87) 455 TiUIImageView E ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:715) 455 TiUIImageView E ti.modules.titanium.ui.widget.TiUIImageView.access$500(TiUIImageView.java:53) 455 TiUIImageView E ti.modules.titanium.ui.widget.TiUIImageView$3.run(TiUIImageView.java:771) 455 TiUIImageView E android.os.Handler.handleCallback(Handler.java:587) 455 TiUIImageView E android.os.Handler.dispatchMessage(Handler.java:92) 455 TiUIImageView E android.os.Looper.loop(Looper.java:123) 455 TiUIImageView E android.app.ActivityThread.main(ActivityThread.java:4627) 455 TiUIImageView E java.lang.reflect.Method.invokeNative(Native Method) 455 TiUIImageView E java.lang.reflect.Method.invoke(Method.java:521) 455 ...
Story points: 3