title: Why I have StackOverflowError when implementing Include in Navigation Controller?
body: <p>my project file: <a href="https://drive.google.com/file/d/11llz7ylWe7ACyLMBbqp6YzugUL8hhImt/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/11llz7ylWe7ACyLMBbqp6YzugUL8hhImt/view?usp=sharing</a></p>
  
  <p>so I have 2 navigation graph. called main navigation graph and also auth graph.</p>
  
  <p>I include main graph into auth graph and vice versa, auth graph in main graph.</p>
  
  <p>I want to implement login system, so when the user successfully logged in then the user will go to main activity (that has bottom navigation view and toolbar), auth activity does not have bottom navigation view or fragment. here is the graphs </p>
  
  <ol>
  <li>main navigation graph:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/08BZt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/08BZt.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;navigation xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              xmlns:tools="http://schemas.android.com/tools"
              android:id="@+id/navigation_graph"
              app:startDestination="@id/destination_home"&gt;
  
      &lt;include app:graph="@navigation/auth_graph" /&gt;
  
      &lt;fragment android:id="@+id/destination_home" android:name="com.muchammadagunglaksana.navcontroller.HomeFragment"
                android:label="Home Judul" tools:layout="@layout/fragment_home"&gt;
          &lt;action android:id="@+id/action_toAuthActivity" app:destination="@id/auth_graph"/&gt;
      &lt;/fragment&gt;
  
  
      &lt;fragment android:id="@+id/destination_camera" android:name="com.muchammadagunglaksana.navcontroller.CameraFragment"
                android:label="Camera Judul" tools:layout="@layout/fragment_camera"&gt;
          &lt;action android:id="@+id/toPhotosDestination" app:destination="@id/destination_photos"/&gt;
      &lt;/fragment&gt;
  
  
      &lt;fragment android:id="@+id/destination_photos" android:name="com.muchammadagunglaksana.navcontroller.PhotosFragment"
                android:label="Foto Judul" tools:layout="@layout/fragment_photos"&gt;
          &lt;action android:id="@+id/toHomeDestination" app:destination="@id/destination_home"/&gt;
          &lt;argument android:name="numberOfPhotos" app:argType="integer" android:defaultValue="0"/&gt;
      &lt;/fragment&gt;
  
  
      &lt;fragment android:id="@+id/destination_settings"
                android:name="com.muchammadagunglaksana.navcontroller.SettingsFragment"
                android:label="Setting Judul" tools:layout="@layout/fragment_settings"/&gt;
  &lt;/navigation&gt;
  </code></pre>
  
  <ol start="2">
  <li><p>Auth graph:
  <a href="https://i.stack.imgur.com/YYcVt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YYcVt.png" alt="enter image description here"></a></p>
  
  <p>
  </p>
  
  <pre><code>&lt;include app:graph="@navigation/navigation_graph" /&gt;
  
  &lt;fragment android:id="@+id/loginFragment" android:name="com.muchammadagunglaksana.navcontroller.LoginFragment"
            android:label="fragment_login" tools:layout="@layout/fragment_login"&gt;
      &lt;action android:id="@+id/action_toMainActivity" app:destination="@id/navigation_graph"/&gt;
  &lt;/fragment&gt;
  </code></pre>
  
  <p></p></li>
  </ol>
  
  <p>when login button clicked in the LoginFragment then I use the code below:</p>
  
  <pre><code>       login_button.setOnClickListener {
              Navigation.findNavController(it).navigate(R.id.action_toMainActivity)
          }
  </code></pre>
  
  <p>and also in the HomeFragment, when the logout button did clicked I use:</p>
  
  <pre><code>logout_button.setOnClickListener {
              Navigation.findNavController(it).navigate(R.id.action_toAuthActivity)
          }
  </code></pre>
  
  <p>but I got stackoverflowerror:</p>
  
  <blockquote>
    <p>E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.muchammadagunglaksana.navcontroller, PID: 14322
        java.lang.StackOverflowError: stack size 8MB
            at android.support.v4.util.SparseArrayCompat.(SparseArrayCompat.java:77)
            at android.support.v4.util.SparseArrayCompat.(SparseArrayCompat.java:62)
            at androidx.navigation.NavGraph.(NavGraph.java:44)
            at androidx.navigation.NavGraphNavigator.createDestination(NavGraphNavigator.java:54)
            at androidx.navigation.NavGraphNavigator.createDestination(NavGraphNavigator.java:29)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:100)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:80)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:128)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:80)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:128)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:80)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:128)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:80)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:128)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:80)
            at androidx.navigation.NavInflater.inflate(NavInflater.java:128)</p>
    
    <p>na.navcontroller E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!</p>
  </blockquote>
  
  <p>what went wrong ?</p>