Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3548] ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2016-05-03T19:11:25.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAppcelerator CLI, Documentation, Studio, Titanium SDK & CLI
LabelsLabel, android
ReporterManish Budhiraja
AssigneeShak Hossain
Created2016-04-26T06:27:13.000+0000
Updated2018-03-19T20:06:38.000+0000

Description

Hi, I'm getting crashes because of ti.modules.titanium.ui.widget.TiUILabel$1 java.lang.ClassCastException Reason: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup Namejava.lang.ClassCastException Reason ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup 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.BackStackRecord.configureTransitions(BackStackRecord.java:1132)
2	at android.support.v4.app.BackStackRecord.beginTransition(BackStackRecord.java:1039)
3	at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:658)
4	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
5	at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
6	at android.os.Handler.handleCallback(Handler.java:739)
7	at android.os.Handler.dispatchMessage(Handler.java:95)
8	at android.os.Looper.loop(Looper.java:145)
9	at android.app.ActivityThread.main(ActivityThread.java:5938)
10	at java.lang.reflect.Method.invoke(Native Method)
11	at java.lang.reflect.Method.invoke(Method.java:372)
12	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389)
13	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
TEST Code XML
<Alloy>
<Window>
<View class="labelOuterContainer"  id="bedroomsContainer">
	<View class="labelInnerContainer" id="bedroomsWrapper">
		<Label id="bedrooms" class="headerLabel" />
		<Label id="bedroomsCount" class="contentLabel" />
	</View>
	<View class="innerView"/>
</View>
</Window>
</Alloy>
TSS
".labelOuterContainer":{
  height: Ti.UI.SIZE,
  width: Ti.UI.SIZE,
  layout: "horizontal",
  top: 10
}

".labelInnerContainer":{
  height: Ti.UI.SIZE,
  width: Ti.UI.SIZE,
  layout: "vertical"
}

".headerLabel":{
  color: Alloy.Globals.Colors.WHITE,
  left: 0,
  font:{
    fontSize: 10
  },
  wordWrap: false,
  ellipsize: true,
  width:Ti.UI.SIZE
}

".headerLabel[formFactor=tablet]":{
  font:{
    fontSize: 16
  }
}

".contentLabel":{
  color: Alloy.Globals.Colors.WHITE,
  top: 3,
  left: 0,
  font:{
    fontSize: 14
  },
  ellipsize: true,
  width:Ti.UI.SIZE
}

".contentLabel[formFactor=tablet]":{
  font:{
    fontSize: 20
  }
}

".headerLabel[platform=ios formFactor=handheld]":{
  minimumFontSize: 10,
  height: 14,
  ellipsize: false
}

".headerLabel[platform=ios formFactor=tablet]":{
  minimumFontSize: 16,
  height: 20,
  ellipsize: false
}


".contentLabel[platform=ios formFactor=handheld]":{
  minimumFontSize: 14,
  height: 18,
  ellipsize: false
}

".contentLabel[platform=ios formFactor=tablet]":{
  minimumFontSize: 20,
  height: 24,
  ellipsize: false
}

".innerView":{
  width: 20,
  height: Ti.UI.SIZE
}

Attachments

FileDateSize
Screen Shot 2016-04-26 at 11.53.32 AM.png2016-04-26T06:24:15.000+0000305622

Comments

  1. Nazmus Salahin 2016-04-26

    Hello, Thanks for reporting. Please provide us test code that we can use to reproduce the reported issue. In this case please give us JS file code. If anything else is needed to reproduce the issue please mention that also. We will be able to identify the problem when we will be able to reproduce the issue. Thanks in advance
  2. Manish Budhiraja 2016-04-26

    Here Find the Js File Code $.bedrooms.text = Alloy.Globals.I18n.t("singular_detail_pages.commons.bedroom"); $.bedroomsCount.text = "3"; It happens sometimes. Nothing else is required to reproduce the issue
  3. Nazmus Salahin 2016-04-27

    Hello [~imbudhiraja], I am unable to reproduce the issue. I replaced Alloy.Globals.While with while but after running the app I get the following error which is obvious. I think the global definitions that you used is needed. *Error Log:*
       [ERROR] :  TiExceptionHandler: (main) [416,416] ----- Titanium Javascript Runtime Error -----
       [ERROR] :  TiExceptionHandler: (main) [1,417] - In alloy/controllers/index.js:100,42
       [ERROR] :  TiExceptionHandler: (main) [0,417] - Message: Uncaught TypeError: Cannot call method 't' of undefined
       [ERROR] :  TiExceptionHandler: (main) [0,417] - Source:     $.bedrooms.text = Alloy.Globals.I18n.t("singular_detail_pages.commons.bedr
       [ERROR] :  V8Exception: Exception occurred at alloy/controllers/index.js:100: Uncaught TypeError: Cannot call method 't' of undefined
       
    Thanks in advance
  4. David Jones 2018-03-19

    We do not have simple code that reproduces the issue, but we do have a stack trace and breadcrumbs that may help. This happens for about 2% of our daily active users {noformat} 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:6823) 11 at java.lang.reflect.Method.invoke(Native Method) 12 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) 13 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) BreadCrumbs: 1 session_start Mar 17, 2018 04:21:35 am UTC 2 session_start Mar 18, 2018 08:10:15 pm UTC 3 foregrounded Mar 18, 2018 08:10:18 pm UTC 4 Connection Up Mar 18, 2018 08:10:18 pm UTC 5 org.appcelerator.titanium.TiActivity : Loaded Mar 18, 2018 08:10:18 pm UTC 6 com.example.app.ExampleAppActivity : Unloaded Mar 18, 2018 08:10:19 pm UTC 7 CRASH java.lang.ClassCastException: ti.modules.titanium.ui.widget.TiUILabel$1 cannot be cast to android.view.ViewGroup Mar 18, 2018 08:12:58 pm UTC {noformat}

JSON Source