Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5299] Android: UI - JSS border properties cause exception

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2011-12-16T09:17:18.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterRoel kramer
AssigneeDon Thorp
Created2011-08-11T04:55:14.000+0000
Updated2014-06-19T12:46:16.000+0000

Description

What: When I specify a border-width of 1px in a jss file Expected: A view with a 1px border Result: It causes the app to crash in the emulator, with an uncaught error. When I specify the border in the view; it does work. See the attached backtrace for more info. Extra info: When i specify border in the view and in the js file it works. My view contains:
var window = Ti.UI.createWindow({
  id:"w"
});

var testView = Ti.UI.createView({
  id: 'testView'
});
window.add(testView);

window.open();
#w {
	background-color:'#00f';
}

#testView {
	top:20;
	width: 100;
	height: 100;
	background-color:'#0f0';
	border-width: 1px;
	border-color: #7a7a7a;
}
E/TiUncaughtHandler(  329): (main) [250,4513] Sending event: exception on thread: main msg:java.lang.NumberFormatException: ; Titanium 1.7.2,2011/07/21 09:36,97c3689
E/TiUncaughtHandler(  329): java.lang.NumberFormatException: 
E/TiUncaughtHandler(  329): 	at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)
E/TiUncaughtHandler(  329): 	at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)
E/TiUncaughtHandler(  329): 	at java.lang.Float.parseFloat(Float.java:291)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:268)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:274)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:689)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:482)
E/TiUncaughtHandler(  329): 	at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:38)
E/TiUncaughtHandler(  329): 	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356)
E/TiUncaughtHandler(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:384)
E/TiUncaughtHandler(  329): 	at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:76)
E/TiUncaughtHandler(  329): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/TiUncaughtHandler(  329): 	at android.os.Looper.loop(Looper.java:123)
E/TiUncaughtHandler(  329): 	at android.app.ActivityThread.main(ActivityThread.java:4627)
E/TiUncaughtHandler(  329): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/TiUncaughtHandler(  329): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/TiUncaughtHandler(  329): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/TiUncaughtHandler(  329): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/TiUncaughtHandler(  329): 	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  329): FATAL EXCEPTION: main
E/AndroidRuntime(  329): java.lang.NumberFormatException: 
E/AndroidRuntime(  329): 	at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)
E/AndroidRuntime(  329): 	at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)
E/AndroidRuntime(  329): 	at java.lang.Float.parseFloat(Float.java:291)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:268)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:274)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:689)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:482)
E/AndroidRuntime(  329): 	at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:38)
E/AndroidRuntime(  329): 	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356)
E/AndroidRuntime(  329): 	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:384)
E/AndroidRuntime(  329): 	at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:76)
E/AndroidRuntime(  329): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(  329): 	at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  329): 	at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  329): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  329): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  329): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  329): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  329): 	at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(   60):   Force finishing activity nl.roelkramer.longlistdemo/org.appcelerator.titanium.TiModalActivity
W/ActivityManager(   60):   Force finishing activity nl.roelkramer.longlistdemo/org.appcelerator.titanium.TiActivity
I/ARMAssembler(   60): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x314688:0x314744] in 4573403 ns
W/ActivityManager(   60): Activity pause timeout for HistoryRecord{4503bd88 nl.roelkramer.longlistdemo/org.appcelerator.titanium.TiModalActivity}
I/Process (  329): Sending signal. PID: 329 SIG: 9
I/ActivityManager(   60): Process nl.roelkramer.longlistdemo (pid 329) has died.
I/WindowManager(   60): WIN DEATH: Window{4502a288 nl.roelkramer.longlistdemo/nl.roelkramer.longlistdemo.LonglistdemoActivity paused=false}
I/WindowManager(   60): WIN DEATH: Window{4508c578 nl.roelkramer.longlistdemo/org.appcelerator.titanium.TiModalActivity paused=false}
I/UsageStats(   60): Unexpected resume of com.android.launcher while already resumed in nl.roelkramer.longlistdemo
I/WindowManager(   60): WIN DEATH: Window{450563f0 nl.roelkramer.longlistdemo/org.appcelerator.titanium.TiActivity paused=false}
W/InputManagerService(   60): Got RemoteException sending setActive(false) notification to pid 329 uid 10036

Attachments

FileDateSize
border_width_traceback.log2011-08-11T04:55:14.000+00008747

Comments

  1. Paul Dowsett 2011-08-11

    Hi Roel Thank you for raising this ticket. In order to progress it, please add the missing information *in the format and places* requested in the guidelines at [Jira Ticket Checklist](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist). For instance, in the environment field: * *Titanium SDK version:* number, build date and build hash, copied and pasted from the console at application launch * *Host Operating System:* OSX x.x, Windows x, Ubuntu x.x * *Titanium Studio version:* copied and pasted from Help / About In the description: * *a link to the Q&A question*, where you asked the community to verify the observed behavior * *a* *[simple usecase](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases)**:* working code that demonstrates issue, placed within a \{code\} wiki markup block. A usecase should run without modification when pasted into a blank app.js file. * *logs:* the console output of any exceptions, placed within a \{code\} wiki markup block Once this is done, we will gladly move it across to the relevant project. Many thanks in advance
  2. Roel kramer 2011-08-12

    Waiting for confirmation in the Q&A section.
  3. Paul Dowsett 2011-09-17

    Thanks for a very well-defined ticket, Roel. I am moving it to the main project.
  4. Paul Dowsett 2011-12-16

    Environment:

    * Titanium 1.8.0.1 (2011/12/16 01:01 61086c9) * Android 2.2 APIs * emulator

    Results (using code above)

         1327         AndroidRuntime  D  >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
         1327         AndroidRuntime  D  CheckJNI is ON
         1327         AndroidRuntime  D  --- registering native functions ---
          60         ActivityManager  I  Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x
                                         10000000 cmp=com.testing.testing8/.Testing8Activity }
          60         ActivityManager  I  Start proc com.testing.testing8 for activity com.testing.testing8/.Testing8Activity: pid=1333 uid=10040 
                                         gids={1015, 3003}
         1327         AndroidRuntime  D  Shutting down VM
         1327         AndroidRuntime  I  NOTE: attach of thread 'Binder Thread #3' failed
         1333          TiApplication  I  (main) [0,0] checkpoint, app created.
         1333          TiApplication  I  (main) [434,434] Titanium 1.8.0.1 (2011/12/16 01:01 61086c9)
         1333              TiFastDev  D  (main) [233,667] Enabling Fastdev on port 36786
         1333              TiFastDev  D  (main) [17,684] sent tokens successfully
         1333              TiFastDev  D  (main) [1,685] Fastdev session handshake succesful.
         1333          TiApplication  I  (main) [12,697] Titanium Javascript runtime: v8
         1333          TiApplication  W  (main) [62,759] activity stack is emtpy, unable to get current activity
         1333         TiRootActivity  I  (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
         1333          TiApplication  W  (main) [414,414] activity stack is emtpy, unable to get current activity
         1333          TiApplication  W  (main) [0,414] activity stack is emtpy, unable to get current activity
         1333          TiApplication  W  (main) [0,414] activity stack is emtpy, unable to get current activity
         1333          TiApplication  E  (KrollRuntimeThread) [1066,1480] APP PROXY: ti.modules.titanium.app.AppModule@44ec2928
         1333          TiAssetHelper  D  Fetching "app.js" with Fastdev...
         1333         AndroidRuntime  D  Shutting down VM
         1333          TiApplication  E  (main) [499,1979] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to sta
                                         rt activity ComponentInfo{com.testing.testing8/com.testing.testing8.Testing8Activity}: java.lang.NumberF
                                         ormatException: ; Titanium 1.8.0.1,2011/12/16 01:01,61086c9
         1333          TiApplication  E  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testing.testing8/com.testing.test
                                         ing8.Testing8Activity}: java.lang.NumberFormatException: 
         1333          TiApplication  E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
         1333          TiApplication  E  	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
         1333          TiApplication  E  	at android.app.ActivityThread.access$2300(ActivityThread.java:125)
         1333          TiApplication  E  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
         1333          TiApplication  E  	at android.os.Handler.dispatchMessage(Handler.java:99)
         1333          TiApplication  E  	at android.os.Looper.loop(Looper.java:123)
         1333          TiApplication  E  	at android.app.ActivityThread.main(ActivityThread.java:4627)
         1333          TiApplication  E  	at java.lang.reflect.Method.invokeNative(Native Method)
         1333          TiApplication  E  	at java.lang.reflect.Method.invoke(Method.java:521)
         1333          TiApplication  E  	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
         1333          TiApplication  E  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
         1333          TiApplication  E  	at dalvik.system.NativeStart.main(Native Method)
         1333          TiApplication  E  Caused by: java.lang.NumberFormatException: 
         1333          TiApplication  E  	at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)
         1333          TiApplication  E  	at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)
         1333          TiApplication  E  	at java.lang.Float.parseFloat(Float.java:291)
         1333          TiApplication  E  	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:325)
         1333          TiApplication  E  	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:334)
         1333          TiApplication  E  	at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:729)
         1333          TiApplication  E  	at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:509)
         1333          TiApplication  E  	at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:39)
         1333          TiApplication  E  	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641)
         1333          TiApplication  E  	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449)
         1333          TiApplication  E  	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441)
         1333          TiApplication  E  	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427)
         1333          TiApplication  E  	at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:520)
         1333          TiApplication  E  	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:264)
         1333          TiApplication  E  	at android.os.Handler.dispatchMessage(Handler.java:95)
         1333          TiApplication  E  	at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318)
         1333          TiApplication  E  	at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303)
         1333          TiApplication  E  	at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188)
         1333          TiApplication  E  	at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215)
         1333          TiApplication  E  	at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143)
         1333          TiApplication  E  	at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417)
         1333          TiApplication  E  	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:337)
         1333          TiApplication  E  	at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:117)
         1333          TiApplication  E  	at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:46)
         1333          TiApplication  E  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
         1333          TiApplication  E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
         1333          TiApplication  E  	... 11 more
         1333         AndroidRuntime  E  FATAL EXCEPTION: main
         1333         AndroidRuntime  E  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.testing.testing8/com.testing.test
                                         ing8.Testing8Activity}: java.lang.NumberFormatException: 
         1333         AndroidRuntime  E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
         1333         AndroidRuntime  E  	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
         1333         AndroidRuntime  E  	at android.app.ActivityThread.access$2300(ActivityThread.java:125)
         1333         AndroidRuntime  E  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
         1333         AndroidRuntime  E  	at android.os.Handler.dispatchMessage(Handler.java:99)
         1333         AndroidRuntime  E  	at android.os.Looper.loop(Looper.java:123)
         1333         AndroidRuntime  E  	at android.app.ActivityThread.main(ActivityThread.java:4627)
         1333         AndroidRuntime  E  	at java.lang.reflect.Method.invokeNative(Native Method)
         1333         AndroidRuntime  E  	at java.lang.reflect.Method.invoke(Method.java:521)
         1333         AndroidRuntime  E  	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
         1333         AndroidRuntime  E  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
         1333         AndroidRuntime  E  	at dalvik.system.NativeStart.main(Native Method)
         1333         AndroidRuntime  E  Caused by: java.lang.NumberFormatException: 
         1333         AndroidRuntime  E  	at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)
         1333         AndroidRuntime  E  	at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)
         1333         AndroidRuntime  E  	at java.lang.Float.parseFloat(Float.java:291)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:325)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.util.TiConvert.toFloat(TiConvert.java:334)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.view.TiUIView.initializeBorder(TiUIView.java:729)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:509)
         1333         AndroidRuntime  E  	at ti.modules.titanium.ui.widget.TiView.processProperties(TiView.java:39)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:520)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:264)
         1333         AndroidRuntime  E  	at android.os.Handler.dispatchMessage(Handler.java:95)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.common.TiMessenger.dispatchMessage(TiMessenger.java:318)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.common.TiMessenger.dispatchPendingMessages(TiMessenger.java:303)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.common.TiMessenger$2.getResult(TiMessenger.java:188)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:215)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.common.TiMessenger.sendBlockingRuntimeMessage(TiMessenger.java:143)
         1333         AndroidRuntime  E  	at org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:417)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:337)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:117)
         1333         AndroidRuntime  E  	at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:46)
         1333         AndroidRuntime  E  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
         1333         AndroidRuntime  E  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
         1333         AndroidRuntime  E  	... 11 more
          60         ActivityManager  W    Force finishing activity com.testing.testing8/.Testing8Activity
          60         ActivityManager  W  Activity pause timeout for HistoryRecord{45060910 com.testing.testing8/.Testing8Activity}
       
  5. Paul Dowsett 2011-12-16

    Roel, the exception is caused by not using the right format for color (must be contained in quotes) and width (if using px, then use quotes, otherwise just use an integer value). Please note the following that has been tested and works as expected. See TIMOB-4895 for more info.
       #testView {
       	top:20;
       	width: 100;
       	height: 100;
       	background-color:'#0f0';
       	border-width: 1;
       	border-color: '#fff';
       }
       

JSON Source