java.lang.ClassCastException: org.appcelerator.kroll.KrollRuntime$1

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.

  • when invalid values are set for width and height an exception occurs when trying to convert the values into TiDimension: {code} var imageView = Ti.UI.createImageView({ width:win.width, height:win.height, image:event.media }); win.add(imageView); {code} * this would be when win.width is undefined. This test case can be found in the KS camera test. Resulting error: {code} 04-04 16:26:45.345 21220 21220 E TiApplication: (main) [9299,18498] Sending event: exception on thread: main msg:java.lang.ClassCastException: org.appcelerator.kroll.KrollRuntime$1; Titanium 2.1.0,2012/04/04 15:16,161fb52 04-04 16:26:45.345 21220 21220 E TiApplication: java.lang.ClassCastException: org.appcelerator.kroll.KrollRuntime$1 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.util.TiConvert.toTiDimension(TiConvert.java:550) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.util.TiConvert.toTiDimension(TiConvert.java:561) 04-04 16:26:45.345 21220 21220 E TiApplication: at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:806) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:737) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:530) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:522) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:500) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:616) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:307) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:110) 04-04 16:26:45.345 21220 21220 E TiApplication: at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) 04-04 16:26:45.345 21220 21220 E TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95) 04-04 16:26:45.345 21220 21220 E TiApplication: at android.os.Looper.loop(Looper.java:143) 04-04 16:26:45.345 21220 21220 E TiApplication: at android.app.ActivityThread.main(ActivityThread.java:4701) 04-04 16:26:45.345 21220 21220 E TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) 04-04 16:26:45.345 21220 21220 E TiApplication: at java.lang.reflect.Method.invoke(Method.java:521) 04-04 16:26:45.345 21220 21220 E TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-04 16:26:45.345 21220 21220 E TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-04 16:26:45.345 21220 21220 E TiApplication: at dalvik.system.NativeStart.main(Native Method) 04-04 16:26:45.353 1401 21298 I MediaScanner: process file: /sdcard/dcim/Camera/tia70621.jpg 04-04 16:26:45.361 1401 21298 D DlnaMediaParser: getJPEGProfileName: 4 04-04 16:26:45.494 1401 1428 D MediaProvider: current image thumbnail number created successfully is:2 04-04 16:26:45.728 1238 1257 D BatteryTempPolicy: updateBatteryTemp temperature = 380, Threshhold = 3 04-04 16:26:45.767 16521 16521 E GlobalUnplugService: plugged = true,mBatteryPlugged=true {code} We should gracefully handle invalid values when they are set or processed either by throwing exceptions to let the developer know of the problem or defaulting to valid values. Requires parity discussion.
    via by Opie Cyrus,
  • when invalid values are set for width and height an exception occurs when trying to convert the values into TiDimension: {code} var imageView = Ti.UI.createImageView({ width:win.width, height:win.height, image:event.media }); win.add(imageView); {code} * this would be when win.width is undefined. This test case can be found in the KS camera test. Resulting error: {code} 04-04 16:26:45.345 21220 21220 E TiApplication: (main) [9299,18498] Sending event: exception on thread: main msg:java.lang.ClassCastException: org.appcelerator.kroll.KrollRuntime$1; Titanium 2.1.0,2012/04/04 15:16,161fb52 04-04 16:26:45.345 21220 21220 E TiApplication: java.lang.ClassCastException: org.appcelerator.kroll.KrollRuntime$1 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.util.TiConvert.toTiDimension(TiConvert.java:550) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.util.TiConvert.toTiDimension(TiConvert.java:561) 04-04 16:26:45.345 21220 21220 E TiApplication: at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:806) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:737) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:530) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:522) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:500) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:616) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:307) 04-04 16:26:45.345 21220 21220 E TiApplication: at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:110) 04-04 16:26:45.345 21220 21220 E TiApplication: at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) 04-04 16:26:45.345 21220 21220 E TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95) 04-04 16:26:45.345 21220 21220 E TiApplication: at android.os.Looper.loop(Looper.java:143) 04-04 16:26:45.345 21220 21220 E TiApplication: at android.app.ActivityThread.main(ActivityThread.java:4701) 04-04 16:26:45.345 21220 21220 E TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) 04-04 16:26:45.345 21220 21220 E TiApplication: at java.lang.reflect.Method.invoke(Method.java:521) 04-04 16:26:45.345 21220 21220 E TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-04 16:26:45.345 21220 21220 E TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-04 16:26:45.345 21220 21220 E TiApplication: at dalvik.system.NativeStart.main(Native Method) 04-04 16:26:45.353 1401 21298 I MediaScanner: process file: /sdcard/dcim/Camera/tia70621.jpg 04-04 16:26:45.361 1401 21298 D DlnaMediaParser: getJPEGProfileName: 4 04-04 16:26:45.494 1401 1428 D MediaProvider: current image thumbnail number created successfully is:2 04-04 16:26:45.728 1238 1257 D BatteryTempPolicy: updateBatteryTemp temperature = 380, Threshhold = 3 04-04 16:26:45.767 16521 16521 E GlobalUnplugService: plugged = true,mBatteryPlugged=true {code} We should gracefully handle invalid values when they are set or processed either by throwing exceptions to let the developer know of the problem or defaulting to valid values. Requires parity discussion.
    via by Opie Cyrus,
    • java.lang.ClassCastException: org.appcelerator.kroll.KrollRuntime$1 at org.appcelerator.titanium.util.TiConvert.toTiDimension(TiConvert.java:550) at org.appcelerator.titanium.util.TiConvert.toTiDimension(TiConvert.java:561) at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:806) at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:737) at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:530) at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:522) at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:500) at org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:616) at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:307) at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:110) at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4701) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) at dalvik.system.NativeStart.main(Native Method)
    No Bugmate found.