title: How to find whats causing Circular Dependencies in RelativeLayout
body: <p>I'm receiving stacktraces of FCs but I can't reproduce the FCs. What am I missing?</p>
  
  <p>In the java code some views are set to <code>View.GONE</code> or <code>View.VISIBLE</code> depending on the state of the app. In the <code>LayoutParams</code> I only change size and margins.</p>
  
  <p>The 2 nestled <code>RelativeLayouts</code> are because the activity has a translucent theme, the second is for an alphafilter which can be applied by the user.</p>
  
  <p>Any help would be great!</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/FNContainer"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@color/clr_background"
  android:paddingTop="8dp" &gt;
  
  &lt;RelativeLayout
      android:id="@+id/AlphaContainer"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;xx.xxxxxx.guielements.Footer
          android:id="@+id/footerInclude"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true" /&gt;
  
      &lt;xx.xxxxxx.guielements.RoseImageView
          android:id="@+id/RoseView"
          android:layout_width="fill_parent"
          android:layout_height="200dp"
          android:layout_above="@id/footerInclude"
          android:layout_centerHorizontal="true"
          android:layout_margin="5dp" /&gt;
  
      &lt;TextView
          android:id="@+id/tvBeschrijving"
          android:layout_width="fill_parent"
          android:layout_height="250dp"
          android:layout_alignParentTop="true"
          android:layout_alignParentLeft="true"
          android:layout_marginLeft="8dp" /&gt;
  
      &lt;xx.xxxxxx.guielements.HmpImageView
          android:id="@+id/HmpView"
          android:layout_width="200dp"
          android:layout_height="200dp"
          android:layout_alignParentLeft="true"
          android:layout_below="@id/tvBeschrijving"
          android:layout_marginLeft="8dp" /&gt;
  
      &lt;TextView
          android:id="@+id/tvDistToEnd"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@id/HmpView"
          android:text="TC Eind: 1253m"
          android:textSize="20sp"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/tvSnelheid"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_alignParentRight="true"
          android:gravity="top|right"
          android:text="120"
          android:textSize="70sp"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/tvSnelheidAanduiding"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@id/tvSnelheid"
          android:gravity="top|right"
          android:text="km/u"
          android:textSize="20sp" /&gt;
  
      &lt;TextView
          android:id="@+id/tvVavg"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@id/tvSnelheidAanduiding"
          android:text="120"
          android:textSize="70sp"
          android:textStyle="bold" /&gt;
      &lt;TextView
          android:id="@+id/tvVavgAanduiding"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@id/tvVavg"
          android:gravity="top|right"
          android:text="Ø km/u"
          android:textSize="20sp" /&gt;
  
      &lt;TextView
          android:id="@+id/tvVmaxOnderbord"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@id/footerInclude"
          android:layout_alignParentRight="true"
          android:background="@drawable/onderbord"
          android:gravity="center"
          android:text="6-18h"
          android:textSize="20sp"
          android:textStyle="bold"
          android:visibility="gone" /&gt;
  
      &lt;TextView
          android:id="@+id/tvVmax"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@id/tvVmaxOnderbord"
          android:layout_alignParentRight="true"
          android:background="@drawable/bg_vmax"
          android:gravity="center"
          android:text="120"
          android:textSize="20sp"
          android:textStyle="bold"
          android:visibility="gone" /&gt;
  
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
  at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1321)
  at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:316)
  at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:337)
  at android.view.View.measure(View.java:15562)
  at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
  at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
  at android.view.View.measure(View.java:15562)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5109)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  at android.view.View.measure(View.java:15562)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5109)
  at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1396)
  at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
  at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
  at android.view.View.measure(View.java:15562)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5109)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
  at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2397)
  at android.view.View.measure(View.java:15562)
  at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1987)
  at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1228)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1401)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1121)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4598)
  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:4921)
  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:1038)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>