java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h5. Problem Description Apps will crash when we set hint text to a numeric value in textbox after opening window. Looks like error is from: https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L233 h5. Test Environment Ti SDK 3.2.1.GA Ti CLI 3.2.1 Android 4.4.2 h5. Test Code index.xml {code} <Alloy> <Window class="container"> <Label id="label" top="30" onClick="doError">throw error</Label> <Label id="label" top="10" onClick="doNoError">no error</Label> <TextField id="txtField" hintText="123"/> </Window> </Alloy> {code} index.js {code} function doError(e) { $.txtField.hintText=456; } function doNoError(e) { $.txtField.hintText='789'; } $.index.open(); {code} h5. Steps to reproduce: # Create new allow project 3.2.1.GA # Update test code to index.js and index.xml file # Launch in android; press label 'throw error' h3. Error Logs {code} [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4c3d648) [ERROR] : TiApplication: (main) [15493,15493] Sending event: exception on thread: main msg:java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String; Titanium 3.2.1,2014/02/06 17:03,991027b [ERROR] : TiApplication: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String [ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUIText.propertyChanged(TiUIText.java:233) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1059) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:327) [ERROR] : TiApplication: at ti.modules.titanium.ui.TextFieldProxy.handleMessage(TextFieldProxy.java:111) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5103) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:525) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {code} h3. Explanation of Error: http://stackoverflow.com/questions/8973381/why-cannot-cast-integer-to-string-in-java
    via by Mostafizur Rahman,
  • h5. Problem Description Apps will crash when we set hint text to a numeric value in textbox after opening window. Looks like error is from: https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L233 h5. Test Environment Ti SDK 3.2.1.GA Ti CLI 3.2.1 Android 4.4.2 h5. Test Code index.xml {code} <Alloy> <Window class="container"> <Label id="label" top="30" onClick="doError">throw error</Label> <Label id="label" top="10" onClick="doNoError">no error</Label> <TextField id="txtField" hintText="123"/> </Window> </Alloy> {code} index.js {code} function doError(e) { $.txtField.hintText=456; } function doNoError(e) { $.txtField.hintText='789'; } $.index.open(); {code} h5. Steps to reproduce: # Create new allow project 3.2.1.GA # Update test code to index.js and index.xml file # Launch in android; press label 'throw error' h3. Error Logs {code} [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4c3d648) [ERROR] : TiApplication: (main) [15493,15493] Sending event: exception on thread: main msg:java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String; Titanium 3.2.1,2014/02/06 17:03,991027b [ERROR] : TiApplication: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String [ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUIText.propertyChanged(TiUIText.java:233) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1059) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:327) [ERROR] : TiApplication: at ti.modules.titanium.ui.TextFieldProxy.handleMessage(TextFieldProxy.java:111) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5103) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:525) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) {code} h3. Explanation of Error: http://stackoverflow.com/questions/8973381/why-cannot-cast-integer-to-string-in-java
    via by Mostafizur Rahman,
    • java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at ti.modules.titanium.ui.widget.TiUIText.propertyChanged(TiUIText.java:233) at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1059) at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:327) at ti.modules.titanium.ui.TextFieldProxy.handleMessage(TextFieldProxy.java:111) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)
    No Bugmate found.