java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via sokuv.com by Unknown author, 1 year ago
android.view.ViewGroup$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
via iswwwup.com by Unknown author, 2 years ago
android.view.ViewGroup$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
via Stack Overflow by bukanamay
, 1 year ago
android.view.ViewGroup$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
via phonesdevelopers.com by Unknown author, 2 years ago
via Stack Overflow by TooTiredToDrink
, 2 years ago
android.widget.FrameLayout$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
via GitHub by Shahar2k5
, 1 year ago
android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
at android.widget.RelativeLayout$DependencyGraph.findRoots(RelativeLayout.java:1352)
at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1299)
at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:316)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:337)
at android.view.View.measure(View.java:15193)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15193)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
at android.view.View.measure(View.java:15193)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4816)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:15193)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1850)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1102)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1275)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4216)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4794)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
6 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.