{ "id": "141774", "key": "TIMOB-18254", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-12-17T15:48:51.000+0000", "priority": null, "labels": [ "type", "typeerror", "value" ], "versions": [], "issuelinks": [ { "id": "44221", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "110448", "key": "TIMOB-12919", "fields": { "summary": "Android: Setting textfield's value to non-string crashes app", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "44220", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "110449", "key": "TIMOB-12920", "fields": { "summary": "Android: setting textfield's autocapitalization property to boolean force-closes app", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "44222", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "124876", "key": "TIMOB-16207", "fields": { "summary": "Android: Setting a property that expect a boolean to a string throws ClassCastException", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-02-28T19:55:25.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "The following code crashes on Android with an IllegalArgumentException because the value needs to be a Boolean. But on iOS it works fine. I would expect a informative error in both cases and no crash on Android.\r\n\r\n{code:javascript}\r\nvar w = Ti.UI.createWindow({backgroundColor:'red'});\r\nvar s = Ti.UI.createSwitch();\r\nw.add(s);\r\nw.open();\r\nsw.value = 1;\r\n{code}\r\n\r\nCrash log:\r\n\r\n{code}\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): FATAL EXCEPTION: main\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): java.lang.RuntimeException: Unable to start activity ComponentInfo{nl.fokkezb.tishadow/org.appcelerator.titanium.TiActivity}: java.lang.IllegalArgumentException: Unable to convert java.lang.Integer to boolean.\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.ActivityThread.access$600(ActivityThread.java:141)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.os.Looper.loop(Looper.java:137)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.ActivityThread.main(ActivityThread.java:5103)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat java.lang.reflect.Method.invoke(Method.java:525)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat dalvik.system.NativeStart.main(Native Method)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): Caused by: java.lang.IllegalArgumentException: Unable to convert java.lang.Integer to boolean.\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.util.TiConvert.toBoolean(TiConvert.java:357)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.util.TiConvert.toBoolean(TiConvert.java:383)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat ti.modules.titanium.ui.widget.TiUISwitch.updateButton(TiUISwitch.java:70)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat ti.modules.titanium.ui.widget.TiUISwitch.setStyle(TiUISwitch.java:176)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat ti.modules.titanium.ui.widget.TiUISwitch.propertyChanged(TiUISwitch.java:99)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat ti.modules.titanium.ui.widget.TiUISwitch.(TiUISwitch.java:36)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat ti.modules.titanium.ui.SwitchProxy.createView(SwitchProxy.java:49)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:483)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:670)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:564)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:232)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:442)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:524)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.Activity.performCreate(Activity.java:5133)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)\r\n12-17 16:41:59.294: E/AndroidRuntime(2017): \t... 11 more\r\n{code}", "attachment": [], "flagged": false, "summary": "Using wrong value type should give informative error instead of crash (on Android)", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "3.4.1.GA", "comment": { "comments": [ { "id": "336771", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Added related tickets", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-12-17T16:03:04.000+0000", "updated": "2014-12-17T16:03:04.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }