Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2263] Application crashes when touchEnabled is set in xml file

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-12-26T06:15:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelsn/a
Reporterlevani
AssigneeShak Hossain
Created2013-12-24T17:13:42.000+0000
Updated2016-03-08T07:41:16.000+0000

Description

I creating a simple alloy android app and noticed that when there is a "touchEnabled" property inside xml markup app crashed with the following error message: {noformat} [ERROR] : TiApplication: (main) [102,102] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.levani.chemigjera/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean; Titanium 3.2.0,2013/12/20 10:57,d9182d6 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.levani.chemigjera/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) [ERROR] : TiApplication: at android.app.ActivityThread.access$600(ActivityThread.java:141) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5041) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) [ERROR] : TiApplication: Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.registerForTouch(TiUIView.java:1455) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.registerForTouch(TiUIView.java:1270) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:474) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:451) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:489) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:473) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:451) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:489) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:473) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:451) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:489) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:473) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:451) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:568) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.add(TiViewProxy.java:546) [ERROR] : TiApplication: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:303) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:451) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:527) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:5104) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) [ERROR] : TiApplication: ... 11 more {noformat} However when I set this property in .tss it works fine. I tested this on android 4.2.2 using genymotion emulator. This is my xml code: if I set touchEnabled="false" on imageview or label app crashed with above error message.

Comments

  1. Ritu Agrawal 2013-12-26

    This is a known issue and is being tracked as part of ticket TIMOB-16063. You can simply work around this issue by using a boolean value instead of a string for touchEnabled property. Change … to … Note that I removed the quotes around false keyword. You can use either true or false.
  2. Rick Blalock 2013-12-27

    Does this apply to any property that should be a bool?
  3. Ritu Agrawal 2013-12-27

    Nope. Just for touchEnabled property.
  4. Shak Hossain 2013-12-31

  5. Raymond Verbruggen 2014-01-06

    When do we as developers get this fixed? All my Alloy apps do not work in Ti 3.2 anymore because of this error, so I am rather stuck...
  6. Ritu Agrawal 2014-01-06

    [~ray@raymondverbruggen.nl] This issue has already been fixed in 3.2.X branch so you can either try a nightly 3.2.X CI build to verify the fix or wait for 3.2.1 release scheduled to be released in few weeks.

JSON Source