[TIMOB-5299] Android: UI - JSS border properties cause exception
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-12-16T09:17:18.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Roel kramer |
Assignee | Don Thorp |
Created | 2011-08-11T04:55:14.000+0000 |
Updated | 2014-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
File | Date | Size |
---|---|---|
border_width_traceback.log | 2011-08-11T04:55:14.000+0000 | 8747 |
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
Waiting for confirmation in the Q&A section.
Thanks for a very well-defined ticket, Roel. I am moving it to the main project.
Environment:
* Titanium 1.8.0.1 (2011/12/16 01:01 61086c9) * Android 2.2 APIs * emulatorResults (using code above)
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.