java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity

Appcelerator JIRA | Ashraf Abu | 1 year ago
  1. 0

    Regression in Master branch using this code: https://jira.appcelerator.org/browse/TIMOB-16619 Actionbar is not available as the activities are no longer extending ActionBarActivity. Instead, they are AppCompatActivity. {code} var win = Ti.UI.createWindow({ title: "Old Title", navBarHidden: false }); var actionBar; win.addEventListener("open", function() { if (Ti.Platform.osname === "android") { if (! win.activity) { Ti.API.error("Can't access action bar on a lightweight window."); } else { actionBar = win.activity.actionBar; if (actionBar) { actionBar.backgroundImage = "/bg.png"; actionBar.title = "New Title"; actionBar.onHomeIconItemSelected = function() { Ti.API.info("Home icon clicked!"); }; } } } }); win.open(); {code} {code} [WARN] : W/System.err: java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity [WARN] : W/System.err: at org.appcelerator.titanium.proxy.ActivityProxy.getActionBar(ActivityProxy.java:255) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:349) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:102) [WARN] : W/System.err: at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:428) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:136) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TiExceptionHandler: (main) [286,286] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,286] - In app.js:12,37 [ERROR] : TiExceptionHandler: (main) [1,287] - Message: Uncaught Error: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity [ERROR] : TiExceptionHandler: (main) [1,288] - Source: actionBar = win.activity.actionBar; [ERROR] : V8Exception: Exception occurred at app.js:12: Uncaught Error: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity {code}

    Appcelerator JIRA | 1 year ago | Ashraf Abu
    java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity
  2. 0

    Regression in Master branch using this code: https://jira.appcelerator.org/browse/TIMOB-16619 Actionbar is not available as the activities are no longer extending ActionBarActivity. Instead, they are AppCompatActivity. {code} var win = Ti.UI.createWindow({ title: "Old Title", navBarHidden: false }); var actionBar; win.addEventListener("open", function() { if (Ti.Platform.osname === "android") { if (! win.activity) { Ti.API.error("Can't access action bar on a lightweight window."); } else { actionBar = win.activity.actionBar; if (actionBar) { actionBar.backgroundImage = "/bg.png"; actionBar.title = "New Title"; actionBar.onHomeIconItemSelected = function() { Ti.API.info("Home icon clicked!"); }; } } } }); win.open(); {code} {code} [WARN] : W/System.err: java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity [WARN] : W/System.err: at org.appcelerator.titanium.proxy.ActivityProxy.getActionBar(ActivityProxy.java:255) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:349) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:102) [WARN] : W/System.err: at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:428) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:136) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TiExceptionHandler: (main) [286,286] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,286] - In app.js:12,37 [ERROR] : TiExceptionHandler: (main) [1,287] - Message: Uncaught Error: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity [ERROR] : TiExceptionHandler: (main) [1,288] - Source: actionBar = win.activity.actionBar; [ERROR] : V8Exception: Exception occurred at app.js:12: Uncaught Error: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity {code}

    Appcelerator JIRA | 1 year ago | Ashraf Abu
    java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity
  3. 0

    Error with Android

    GitHub | 9 months ago | annamf
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.epi.cuponisimo/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    WARNINGS since Android6

    GitHub | 9 months ago | AppWerft
    java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity
  6. 0

    GitHub comment 68#233338139

    GitHub | 5 months ago | ChanakyaSrinivas
    java.lang.ClassCastException: org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.appcelerator.titanium.TiActivity cannot be cast to android.support.v7.app.ActionBarActivity

      at org.appcelerator.titanium.proxy.ActivityProxy.getActionBar()
    2. org.appcelerator.titanium
      ActivityProxy.getActionBar
      1. org.appcelerator.titanium.proxy.ActivityProxy.getActionBar(ActivityProxy.java:255)
      1 frame
    3. org.appcelerator.kroll
      KrollProxy.handleMessage
      1. org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
      2. org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
      3. org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908)
      4. org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131)
      4 frames
    4. org.appcelerator.titanium
      TiWindowProxy.handleMessage
      1. org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:349)
      2. org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:102)
      2 frames
    5. ti.modules.titanium
      WindowProxy.handleMessage
      1. ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:428)
      1 frame
    6. Android Platform
      Looper.loop
      1. android.os.Handler.dispatchMessage(Handler.java:98)
      2. android.os.Looper.loop(Looper.java:136)
      2 frames
    7. org.appcelerator.kroll
      KrollRuntime$KrollRuntimeThread.run
      1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
      1 frame