Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25431] Android: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup;

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-08-03T18:56:56.000+0000
Affected Version/sRelease 6.2.2
Fix Version/sRelease 7.3.0, Release 7.2.1
ComponentsAndroid
Labelsandroid, label, regression
ReporterHans Knöchel
AssigneeGary Mathews
Created2017-10-24T07:35:03.000+0000
Updated2019-01-08T22:42:36.000+0000

Description

Filing this ticket from the community just in case it's our issue:
[ERROR] :  TiApplication: (main) [85,105171] Sending event: exception on thread: main msg:java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup; Titanium 6.2.2,2017/09/19 16:01,undefined
[ERROR] :  TiApplication: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup
[ERROR] :  TiApplication:     at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:293)
[ERROR] :  TiApplication:     at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:118)
[ERROR] :  TiApplication:     at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2364)
[ERROR] :  TiApplication:     at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)
[ERROR] :  TiApplication:     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)
[ERROR] :  TiApplication:     at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)
[ERROR] :  TiApplication:     at android.os.Handler.handleCallback(Handler.java:739)
[ERROR] :  TiApplication:     at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] :  TiApplication:     at android.os.Looper.loop(Looper.java:148)
[ERROR] :  TiApplication:     at android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] :  TiApplication:     at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiApplication:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] :  TiApplication:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Comments

  1. Joshua Quick 2017-10-24

    [~hknoechel], we need sample code in order to reproduce this issue. Can you ask this person to provide some test code please? From looking at the stack trace, I suspect this is a bug on Google's end. Might be a new bug introduced in the v26 support libraries and we'll have to figure out a work-around.
  2. Brian Knorr 2018-01-12

    We are getting this issue as well...201 times in the last 14 days. Our crash rate is almost 5% because of this bug. What is causing this? Crashed Thread 0 java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup ! 1 at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:293) 2 at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:118) 3 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2364) 4 at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322) 5 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229) 6 at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700) 7 at android.os.Handler.handleCallback(Handler.java:751) 8 at android.os.Handler.dispatchMessage(Handler.java:95) 9 at android.os.Looper.loop(Looper.java:154) 10 at android.app.ActivityThread.main(ActivityThread.java:6688) 11 at java.lang.reflect.Method.invoke(Native Method) 12 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) 13 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
  3. Joshua Quick 2018-01-12

    [~btknorr], I don't see anything incriminating in the stack-trace. From the looks of it, a Titanium label is being added to a non-Titanium native Android view. The exception is coming from Google's end (a Fragment in this case), indicating that it was given a non-ViewGroup derived class. Are you using hyper-loop or a 3rd party module to display UI that Titanium does not support? Also, are you using TabGroups?
  4. Brian Knorr 2018-01-13

    Ya we don't get it either....we do not use TabGroups ever. We only use standard views...we use hyperloop for credit card scanning via card.io but this is not the issue. We do notice though that frequently when you open a titanium app on Android that it closes immediately and then opens back up. Maybe this is cause?
  5. Muhammad Ahmed Fahad 2018-01-15

  6. Gary Mathews 2018-01-16

    [~fahad86] Could you provide details of what devices this occurs most often on and also what Android version they are running?
  7. Muhammad Ahmed Fahad 2018-01-17

    seems to be quite distributed: Cluster 1 (Samsung devices Android 7.0/7.1): https://s3-ap-southeast-1.amazonaws.com/uploads-ap.hipchat.com/56929/750866/kmzXwZt3hgfSyjE/Screen%20Shot%202018-01-17%20at%2010.06.26%20AM.png Cluster 2 (mixed Android 7.X/8.1): https://s3-ap-southeast-1.amazonaws.com/uploads-ap.hipchat.com/56929/750866/LZHSnvPA8H1TrfH/Screen%20Shot%202018-01-17%20at%2010.07.27%20AM.png Cluster 3 (mixed Android 5.X/6.X): https://s3-ap-southeast-1.amazonaws.com/uploads-ap.hipchat.com/56929/750866/CWcsd1kY4KnQTtx/Screen%20Shot%202018-01-17%20at%2010.08.01%20AM.png Even though the error clusters are different, the stack stacks are pretty much the same:
       java.lang.RuntimeException: 
         at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2927)
         at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2988)
         at android.app.ActivityThread.-wrap14 (ActivityThread.java)
         at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1631)
         at android.os.Handler.dispatchMessage (Handler.java:102)
         at android.os.Looper.loop (Looper.java:154)
         at android.app.ActivityThread.main (ActivityThread.java:6682)
         at java.lang.reflect.Method.invoke (Native Method)
         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1534)
         at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1424)
       Caused by: java.lang.ClassCastException: 
         at android.support.v4.app.FragmentTransition.configureTransitionsOrdered (FragmentTransition.java:293)
         at android.support.v4.app.FragmentTransition.startTransitions (FragmentTransition.java:118)
         at android.support.v4.app.FragmentManagerImpl.executeOpsTogether (FragmentManager.java:2364)
         at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute (FragmentManager.java:2322)
         at android.support.v4.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:2229)
         at android.support.v4.app.FragmentManagerImpl.dispatchStateChange (FragmentManager.java:3221)
         at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated (FragmentManager.java:3171)
         at android.support.v4.app.FragmentController.dispatchActivityCreated (FragmentController.java:192)
         at android.support.v4.app.FragmentActivity.onStart (FragmentActivity.java:552)
         at android.support.v7.app.AppCompatActivity.onStart (AppCompatActivity.java:177)
         at org.appcelerator.titanium.TiBaseActivity.onStart (TiBaseActivity.java:1372)
         at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1256)
         at android.app.Activity.performStart (Activity.java:6959)
         at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2890)
       
  8. Muhammad Ahmed Fahad 2018-01-17

    On Crittercism we get the stacktrace: Name java.lang.ClassCastException Reason Unable to start activity ComponentInfo{xxxx.xxxx/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: ti.modules.tita... App Version 5.6.5 Crashed Thread 0 java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxx.xxxx/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 1 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984) 2 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) 3 at android.app.ActivityThread.-wrap14(ActivityThread.java) 4 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 5 at android.os.Handler.dispatchMessage(Handler.java:102) 6 at android.os.Looper.loop(Looper.java:154) 7 at android.app.ActivityThread.main(ActivityThread.java:6776) 8 at java.lang.reflect.Method.invoke(Native Method) 9 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) 10 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) 11 Caused by: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 12 at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:293) 13 at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:118) 14 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2364) 15 at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322) 16 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229) 17 at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3221) 18 at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3171) 19 at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:192) 20 at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:552) 21 at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177) 22 at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1372) 23 at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256) 24 at android.app.Activity.performStart(Activity.java:6972) 25 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2937) 26 ... 9 more 27 java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 28 at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:293) 29 at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:118) 30 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2364) 31 at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322) 32 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229) 33 at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3221) 34 at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3171) 35 at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:192) 36 at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:552) 37 at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177) 38 at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1372) 39 at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256) 40 at android.app.Activity.performStart(Activity.java:6972) 41 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2937) 42 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) 43 at android.app.ActivityThread.-wrap14(ActivityThread.java) 44 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 45 at android.os.Handler.dispatchMessage(Handler.java:102) 46 at android.os.Looper.loop(Looper.java:154) 47 at android.app.ActivityThread.main(ActivityThread.java:6776) 48 at java.lang.reflect.Method.invoke(Native Method) 49 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) 50 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
  9. Gary Mathews 2018-01-17

    [~fahad86] Thanks for responding with more details! Do you use any transition animations for your Windows?
  10. Muhammad Ahmed Fahad 2018-01-17

    Yes we do: { activityEnterAnimation: Ti.App.Android.R.anim.slide_in_right, activityExitAnimation: Ti.Android.R.anim.slide_out_right } only recently. But this issue has been happening well before the transitions were added
  11. Brian Knorr 2018-01-18

    And we don't use transition animations on windows...only views. Here is a screenshot of our stats for this crash from google play for the last 60 days. https://snag.gy/HlRk7D.jpg
  12. Michael Gangolf 2018-01-26

    Have this error too:
        01-26 21:53:09.709: E/AndroidRuntime(19836): FATAL EXCEPTION: main
        01-26 21:53:09.709: E/AndroidRuntime(19836): Process: com.app, PID: 19836
        01-26 21:53:09.709: E/AndroidRuntime(19836): java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:293)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:118)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2364)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.os.Handler.handleCallback(Handler.java:751)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.os.Handler.dispatchMessage(Handler.java:95)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.os.Looper.loop(Looper.java:173)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at android.app.ActivityThread.main(ActivityThread.java:6459)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at java.lang.reflect.Method.invoke(Native Method)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
        01-26 21:53:09.709: E/AndroidRuntime(19836): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
        
    Titanium SDK 7.0.2.RC HTC A9 Android 7 Its in a bigger app, no transition animations. Main part is a scrollable view with 3 views and a bottom menu. I can reproduce the error when I close (back button) the app during the start process. When I restart the app again it will crash with that error. If I start the app, use it or just leave it open for some seconds it works fine. I'll try to see if I can reproduce it in a demo app.
  13. Gary Mathews 2018-01-26

    [~michael] Thanks! That would be really helpful
  14. Joshua Quick 2018-01-26

    [~btknorr], [~michael], Are you guys setting a Label's "minimumFontSize" property?
  15. Michael Gangolf 2018-01-26

    No. I'm currently in the progress of stripping down my app to a bare minimum. Then you can have a look
  16. Gary Mathews 2018-02-09

    [~michael] were you able to create a reproducible test case? We're having a hard time reproducing this issue.
  17. Mike Stancliffe 2018-02-09

    This issue has been a source of pain for us for some time now. For months we haven't been able to pinpoint when or where it is happening. Today we found a reproducible scenario to have this occur, unfortunately it's within our large scale app not a neat little sample.
  18. Joshua Quick 2018-02-09

    Can any of you guess "when" this started happening to you? This might help us narrow it down. Also, which Android OS versions you think it's happening on? For example, if it's only happening on Android 7.0 and above, then this might indicate it's a Google bug we might need to work-around and not a bug introduced into Titanium. From the stack trace, you can see that the exception is happening on Google's side. So, this might be the case.
  19. Michael Gangolf 2018-02-11

    @[~jquick][~gmathews] Sorry I wasn't successful in creating an example. In fact the app which I've stated above doesn't have this problem anymore! I was able to reproduce it every time and now it is gone. I've changed a lot of code (e.g. more collection/listview related stuff into onOpen events) and switched to 7.0.2.GA and it looks like it is gone now. I go back in my GIT repo to see if the old code still produces this error. Phone: HTC A9 Android 7
  20. Muhammad Ahmed Fahad 2018-02-12

    This issue reduced significantly (but still present) when we removed a ti.map view from a page that we open often. We replaced it with an image view with a picture of the map instead.
  21. Mike Stancliffe 2018-02-14

    After reading the above comment, we noticed a pattern in our app, we see this very consistently while closing/removing a map view while in motion(zooming or panning to a pin for example). We had 100% success in reproducing under these conditions. If I get time I will try to build a simple example of this.
  22. Gary Mathews 2018-02-14

    Bumping from 7.1.0 as we still do not have a reproducible test case.
  23. Michael Gangolf 2018-04-30

    with the 7.1.1.RC I got that error today:
        04-30 21:48:30.383  6858  6858 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2725)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2786)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1501)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:173)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6459)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime: Caused by: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:293)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:118)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2364)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3221)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3171)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:192)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:552)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1339)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1299)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.Activity.performStart(Activity.java:6690)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2688)
        04-30 21:48:30.383  6858  6858 E AndroidRuntime:        ... 9 more
        
    still no way to really reproduce it, just wanted to add it for the error stack and error lines
  24. Gary Mathews 2018-04-30

    master: https://github.com/appcelerator/titanium_mobile/pull/10017
  25. Michael Gangolf 2018-05-01

    nice work [~gmathews]!
  26. Muhammad Ahmed Fahad 2018-05-02

    Any chance we can backport this to 7.1.1?
  27. Joshua Quick 2018-05-02

    [~fahad86], unfortunately it is too late to add it to Titanium 7.1.1. We plan is to add it to the next release. Likely 7.2.0. The issue is caused by creating UI for the next window you're about to open while you're close the current window.
  28. Samir Mohammed 2018-07-05

    Closing ticket, Verified code fix in SDK Version: 7.3.0.v20180628132121.
  29. Muhammad Ahmed Fahad 2018-07-12

    We are using the Ti SDK 7.3.0.v20180709142952 in production but we can still see this issue recurring (not very frequently though): Name java.lang.ClassCastException Reason Unable to start activity ComponentInfo{spacious.home/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: ti.modules.tita... App Version 5.9.1 Crashed Thread 0 java.lang.RuntimeException: Unable to start activity ComponentInfo{spacious.home/org.appcelerator.titanium.TiActivity}: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 1 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955) 2 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) 3 at android.app.ActivityThread.-wrap11(Unknown Source:0) 4 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 5 at android.os.Handler.dispatchMessage(Handler.java:105) 6 at android.os.Looper.loop(Looper.java:164) 7 at android.app.ActivityThread.main(ActivityThread.java:6938) 8 at java.lang.reflect.Method.invoke(Native Method) 9 at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 10 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 11 Caused by: java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 12 at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:310) 13 at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:134) 14 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2380) 15 at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338) 16 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245) 17 at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3248) 18 at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3200) 19 at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195) 20 at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597) 21 at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177) 22 at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1362) 23 at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1340) 24 at android.app.Activity.performStart(Activity.java:7191) 25 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2918) 26 ... 9 more 27 java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 28 at android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:310) 29 at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:134) 30 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2380) 31 at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338) 32 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245) 33 at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3248) 34 at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3200) 35 at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195) 36 at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597) 37 at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177) 38 at org.appcelerator.titanium.TiBaseActivity.onStart(TiBaseActivity.java:1362) 39 at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1340) 40 at android.app.Activity.performStart(Activity.java:7191) 41 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2918) 42 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) 43 at android.app.ActivityThread.-wrap11(Unknown Source:0) 44 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 45 at android.os.Handler.dispatchMessage(Handler.java:105) 46 at android.os.Looper.loop(Looper.java:164) 47 at android.app.ActivityThread.main(ActivityThread.java:6938) 48 at java.lang.reflect.Method.invoke(Native Method) 49 at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 50 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
  30. Michael Gangolf 2018-07-29

    When running *7.2.1.v20180726150551* I still get this {noformat} ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup {noformat} error and when running *7.3.0.v20180727082501 (7.3.0 RC)* I'll get a freeze with a black screen and no error message: [Video of the problem](https://migaweb.de/730rc_freeze.mp4) (opening and closing windows, 3rd window will freeze the app). it's happening way more often than the label error! In 7.2.0.GA I barely see the label error
  31. Michael Gangolf 2018-07-29

    I'm starting to see these warnings {noformat} [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1029) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1039) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1057) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1067) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1043) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1053) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1097) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1096) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1095) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1091) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1090) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1089) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1085) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1084) [WARN] JavaObject: Could not obtain reference, java object has already been collected! (Key: 1083) [INFO] I/Google Maps Android API: Google Play services package version: 12874025 [INFO] art: Starting a blocking GC HeapTrim {noformat} https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/native/JavaObject.cpp#L83 before the black screen
  32. Gary Mathews 2018-07-30

  33. Michael Gangolf 2018-07-30

    still trying to create a test without any luck yet.
        // ----- index
        
        Alloy.Globals.window.openWin = function(win) {
        	win.open();
        }
        
        // ----- inside the listview window:
        
        function openDetails(id) {
        			var w = Alloy.createController("placeDetail", {
        				id: id
        			});
        			Alloy.Globals.window.openWin(w.getView());
        			w = null;
        }
        
    The child window has some images, labels, views, a map, is using a model instance and http request (destroy, off and setting most stuff to null when closing the window). I'm trying to create a example that features most of the things so it can be compared. TIMOB-26222: that example is working fine for me with 7.3.0.RC 7.3.0.v20180711185043 is crashing/freezing too! *Edit:* simplified the example, removed the activity indicator and stuff. Still freezing
  34. Gary Mathews 2018-07-30

    [~michael] When your placeDetail controller is destroyed (pressing back), it's important to no re-use any child views of that Window as they will also be destroyed. If you want to re-use them again, you should remove them first. I'm just guessing, as I don't have a lot to go off. I would need to see your placeDetail controller.
  35. Michael Gangolf 2018-07-30

    I think I found the issue! I remove all of the controller code and added it back line by line (still have of the code removed). There is a scrollableView.addEventListener("scrollend", onScrollEndImages); event listener I only add when I have multiple images and I didn't remove that listener when closing the window! So I guess it's just my code that was the problem. But strange that it was working in 7.2.0 (this one was merged into 7.3.0: https://github.com/appcelerator/titanium_mobile/pull/9696) So I still work my way up the code stack. Giving up for today: even I remove the scrollend listener it will freeze once I have my whole code back in. So the leak is somewhere else :-/
  36. Gary Mathews 2018-07-30

    [~michael] Try this build: https://eu.syncplicity.com/share/rrvefj7xa38thvw/7.3.0.v20180727082501 I've slightly modified the behavior of Windows, maybe this could improve the issue? NOTE: It's not really 7.3.0.v20180727082501, I've replaced some files inside.
  37. Michael Gangolf 2018-07-31

    at the beginning it was better but then I ended up with: {noformat} F libc : Fatal signal 6 (SIGABRT), code -6 in tid 14574 (miga.app) W : debuggerd: handling request: pid=14574 uid=10976 gid=10976 tid=14574 DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** DEBUG : Build fingerprint: 'htc/hiaeuhl_00401/htc_hiaeuhl:7.0/NRD90M/876837.2:user/release-keys' DEBUG : Revision: '0' DEBUG : ABI: 'arm64' DEBUG : pid: 14574, tid: 14574, name: miga.app >>> com.miga.app <<< DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- DEBUG : Abort message: 'art/runtime/java_vm_ext.cc:508] JNI DETECTED ERROR IN APPLICATION: obj == null' DEBUG : x0 0000000000000000 x1 00000000000038ee x2 0000000000000006 x3 0000000000000008 DEBUG : x4 000000000000000d x5 0000007f82ed0000 x6 486674aa7f000000 x7 0000007faa746648 DEBUG : x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001 DEBUG : x12 ffffffffffffffff x13 0000000000000000 x14 0000000000000000 x15 00000000007f82ed DEBUG : x16 0000007faa788ed8 x17 0000007faa732314 x18 0000000000000000 x19 0000007fad14db40 DEBUG : x20 0000000000000006 x21 0000007fad14da98 x22 0000000000000002 x23 0000000000000b38 DEBUG : x24 ffffffffffffffff x25 0000007fa95f5730 x26 0000007fa957ee58 x27 0000007fd168e561 DEBUG : x28 0000007fa95444ab x29 0000007fd168e490 x30 0000007faa72f7a4 DEBUG : sp 0000007fd168e470 pc 0000007faa73231c pstate 0000000000000000 DEBUG : DEBUG : backtrace: DEBUG : #00 pc 000000000006c31c /system/lib64/libc.so (tgkill+8) DEBUG : #01 pc 00000000000697a0 /system/lib64/libc.so (pthread_kill+64) DEBUG : #02 pc 00000000000242d0 /system/lib64/libc.so (raise+24) DEBUG : #03 pc 000000000001ccec /system/lib64/libc.so (abort+52) DEBUG : #04 pc 0000000000431c70 /system/lib64/libart.so (_ZN3art7Runtime5AbortEv+352) DEBUG : #05 pc 00000000000e5324 /system/lib64/libart.so (_ZN3art10LogMessageD2Ev+1204) DEBUG : #06 pc 00000000002f0404 /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+2172) DEBUG : #07 pc 00000000002f07c8 /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+184) DEBUG : #08 pc 000000000033c860 /system/lib64/libart.so (_ZN3art3JNI14GetObjectFieldEP7_JNIEnvP8_jobjectP9_jfieldID+740) DEBUG : #09 pc 000000000052ae78 /data/app/com.miga.app-1/lib/arm64/libkroll-v8.so {noformat}
  38. Gary Mathews 2018-07-31

    [~michael] Do you have a larger trace?
  39. Gary Mathews 2018-08-01

    [~michael] Here's a build based off https://github.com/appcelerator/titanium_mobile/pull/10221 https://eu.syncplicity.com/share/0tbgyfgiwab00tj/mobilesdk-7.3.0.v20180801124941-osx This should resolve the issue.
  40. Lokesh Choudhary 2018-08-03

    Verified the fix in SDK 7.2.1.v20180726150551. Closing.
  41. Michael Gangolf 2018-11-20

    Starting to see this again with 7.5.0.GA in combination with liveview:
        [ERROR] TiExceptionHandler: (main) [263,1634] ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup
        [ERROR] TiExceptionHandler:
        [ERROR] TiExceptionHandler:     android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:310)
        [ERROR] TiExceptionHandler:     android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:134)
        [ERROR] TiExceptionHandler:     android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2380)
        [ERROR] TiExceptionHandler:     android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)
        [ERROR] TiExceptionHandler:     android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245)
        [ERROR] TiExceptionHandler:     android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703)
        [ERROR] TiExceptionHandler:     android.os.Handler.handleCallback(Handler.java:751)
        [ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:95)
        [ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:173)
        [ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:6459)
        [ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
        [ERROR] TiExceptionHandler:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)
        [ERROR] TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
        
    When I reload the app for the first time (first change in liveview 1.4.0) it will freeze with this error. It looks like the whole screen is renderered (at least the visible elements in the first scrollableView). It's the same app as before and it was working better in 7.4.1.GA
  42. Felipe Mathies 2019-01-08

    I`m seeing this error on 7.5.1.v20181218070137 too...my app is having multiples crahings with this... ~[ERROR] TiExceptionHandler: (main) [3104,33176] ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup [ERROR] TiExceptionHandler: [ERROR] TiExceptionHandler: android.support.v4.app.FragmentTransition.configureTransitionsOrdered(FragmentTransition.java:310) [ERROR] TiExceptionHandler: android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:134) [ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2380) [ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338) [ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245) [ERROR] TiExceptionHandler: android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703) [ERROR] TiExceptionHandler: android.os.Handler.handleCallback(Handler.java:739) [ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:95) [ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:145) [ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6917) [ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method) [ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Method.java:372) [ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) [ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)~ Can you guys reopen this? this is affecting my app on production really bad....

JSON Source