java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy

Appcelerator JIRA | Stefan Schüller | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    How to reproduce: # make new alloy project # add the following files: ** controllers/index.js {code} $.index.open(); $.contentView.add(Alloy.createController('list').getView()); {code} ** controllers/list.js (empty) ** controllers/test.js (empty) ** views/index.xml {code} <Alloy> <Window id="index"> <View id="contentView" /> </Window> </Alloy> {code} ** views/list.xml {code} <Alloy> <Require src="test" /> </Alloy> {code} ** views/test.xml {code} <Alloy> <View/> </Alloy> {code} Same problem exists when doing this inside a Widget with <Widget> and Widget.createController(). This code causes the following crash on starting the app on Android. {code} [ERROR] TiApplication: (main) [316,316] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy; Titanium 3.4.1,2014/11/13 13:33,5982e8f [ERROR] TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy [ERROR] TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) [ERROR] TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) [ERROR] TiApplication: at android.app.ActivityThread.access$600(ActivityThread.java:141) [ERROR] TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) [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: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) [ERROR] TiApplication: Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy [ERROR] TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.setActivity(TiViewProxy.java:976) [ERROR] TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.setActivity(TiViewProxy.java:977) [ERROR] TiApplication: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:175) [ERROR] TiApplication: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32) [ERROR] TiApplication: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:442) [ERROR] TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:524) [ERROR] TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] TiApplication: at android.app.Activity.performCreate(Activity.java:5133) [ERROR] TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) [ERROR] TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) [ERROR] TiApplication: ... 11 more {code}

    Appcelerator JIRA | 2 years ago | Stefan Schüller
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy
  2. 0

    How to reproduce: # make new alloy project # add the following files: ** controllers/index.js {code} $.index.open(); $.contentView.add(Alloy.createController('list').getView()); {code} ** controllers/list.js (empty) ** controllers/test.js (empty) ** views/index.xml {code} <Alloy> <Window id="index"> <View id="contentView" /> </Window> </Alloy> {code} ** views/list.xml {code} <Alloy> <Require src="test" /> </Alloy> {code} ** views/test.xml {code} <Alloy> <View/> </Alloy> {code} Same problem exists when doing this inside a Widget with <Widget> and Widget.createController(). This code causes the following crash on starting the app on Android. {code} [ERROR] TiApplication: (main) [316,316] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy; Titanium 3.4.1,2014/11/13 13:33,5982e8f [ERROR] TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy [ERROR] TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) [ERROR] TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) [ERROR] TiApplication: at android.app.ActivityThread.access$600(ActivityThread.java:141) [ERROR] TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) [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: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) [ERROR] TiApplication: Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy [ERROR] TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.setActivity(TiViewProxy.java:976) [ERROR] TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.setActivity(TiViewProxy.java:977) [ERROR] TiApplication: at ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:175) [ERROR] TiApplication: at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32) [ERROR] TiApplication: at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:442) [ERROR] TiApplication: at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:524) [ERROR] TiApplication: at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) [ERROR] TiApplication: at android.app.Activity.performCreate(Activity.java:5133) [ERROR] TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) [ERROR] TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) [ERROR] TiApplication: ... 11 more {code}

    Appcelerator JIRA | 2 years ago | Stefan Schüller
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.util.HashMap cannot be cast to org.appcelerator.titanium.proxy.TiViewProxy

      at org.appcelerator.titanium.proxy.TiViewProxy.setActivity()
    2. org.appcelerator.titanium
      TiViewProxy.setActivity
      1. org.appcelerator.titanium.proxy.TiViewProxy.setActivity(TiViewProxy.java:976)
      2. org.appcelerator.titanium.proxy.TiViewProxy.setActivity(TiViewProxy.java:977)
      2 frames
    3. ti.modules.titanium
      WindowProxy.windowCreated
      1. ti.modules.titanium.ui.WindowProxy.windowCreated(WindowProxy.java:175)
      1 frame
    4. org.appcelerator.titanium
      TiActivity.onCreate
      1. org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:32)
      2. org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:442)
      3. org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:524)
      4. org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18)
      4 frames
    5. Android Platform
      ActivityThread.main
      1. android.app.Activity.performCreate(Activity.java:5133)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      5. android.app.ActivityThread.access$600(ActivityThread.java:141)
      6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      7. android.os.Handler.dispatchMessage(Handler.java:99)
      8. android.os.Looper.loop(Looper.java:137)
      9. android.app.ActivityThread.main(ActivityThread.java:5103)
      9 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:525)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      2 frames
    8. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame