title: java.lang.IllegalArgumentException: menu item with ID 2131558727 doesn't have a MediaRouteActionProvider
body: <p>Hi i am integrating chromecast functionality into my existing app.i have the following code :</p>
  
  <pre><code>public class VideoBrowserActivity extends AppCompatActivity {
  
      private static final String TAG = "VideoBrowserActivity";
      private boolean mIsHoneyCombOrAbove = Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB;
      private Toolbar mToolbar;
      private CastContext mCastContext;
      private MenuItem mediaRouteMenuItem;
      private IntroductoryOverlay mIntroductoryOverlay;
      private CastStateListener mCastStateListener;
  
      /*
       * (non-Javadoc)
       * @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
       */
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.video_browser);
          setupActionBar();
  
          mCastStateListener = new CastStateListener() {
              @Override
              public void onCastStateChanged(int newState) {
                  if (newState != CastState.NO_DEVICES_AVAILABLE) {
                      Log.e("DEBUG","===");
                      showIntroductoryOverlay();
                  }
              }
          };
  
          mCastContext = CastContext.getSharedInstance(this);
      }
  
      @Override
      protected void onResume() {
          mCastContext.addCastStateListener(mCastStateListener);
          super.onResume();
      }
  
      @Override
      protected void onPause() {
          mCastContext.removeCastStateListener(mCastStateListener);
          super.onPause();
      }
  
  
      private void setupActionBar() {
          mToolbar = (Toolbar) findViewById(R.id.toolbar);
          mToolbar.setTitle(R.string.app_name);
          setSupportActionBar(mToolbar);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          super.onCreateOptionsMenu(menu);
          getMenuInflater().inflate(R.menu.browse, menu);
          mediaRouteMenuItem = CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), menu,
                  R.id.media_route_menu_item);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          Intent i;
          switch (item.getItemId()) {
              case R.id.action_settings:
                  i = new Intent(VideoBrowserActivity.this, CastPreference.class);
                  startActivity(i);
                  break;
          }
          return true;
      }
  
      @Override
      protected void onDestroy() {
          Log.d(TAG, "onDestroy is called");
          super.onDestroy();
      }
  
  
      private void showIntroductoryOverlay() {
          if (mIntroductoryOverlay != null) {
              mIntroductoryOverlay.remove();
          }
          if ((mediaRouteMenuItem != null) &amp;&amp; mediaRouteMenuItem.isVisible()) {
              new Handler().post(new Runnable() {
                  @Override
                  public void run() {
                      mIntroductoryOverlay = new IntroductoryOverlay.Builder(
                              VideoBrowserActivity.this, mediaRouteMenuItem)
                              .setTitleText("Introducing Cast")
                              .setSingleTime()
                              .setOnOverlayDismissedListener(
                                      new IntroductoryOverlay.OnOverlayDismissedListener() {
                                          @Override
                                          public void onOverlayDismissed() {
                                              mIntroductoryOverlay = null;
                                          }
                                      })
                              .build();
                      mIntroductoryOverlay.show();
                  }
              });
          }
      }
  }
  </code></pre>
  
  <p>and these are xml files</p>
  
  <p>browswer.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;item
              android:id="@+id/media_route_menu_item"
              android:title="@string/media_route_menu_title"
              app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider"
              app:showAsAction="always"/&gt;
  
      &lt;item
              android:id="@+id/action_settings"
              android:title="@string/action_settings"
              app:showAsAction="never"/&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>and expanded_controller.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;item
              android:id="@+id/media_route_menu_item"
              android:title="@string/media_route_menu_title"
              app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider"
              app:showAsAction="always"/&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>when i am running this code i am getting the folowing  error</p>
  
  <p>j</p>
  
  <pre><code>ava.lang.IllegalArgumentException: menu item with ID 2131558727 doesn't have a MediaRouteActionProvider.
                                                                                 at com.google.android.gms.cast.framework.CastButtonFactory.setUpMediaRouteButton(Unknown Source)
                                                                                 at com.calkins.tv_everywhere.VideoBrowserActivity.onCreateOptionsMenu(VideoBrowserActivity.java:1168)
                                                                                 at android.app.Activity.onCreatePanelMenu(Activity.java:3128)
                                                                                 at com.android.internal.policy.PhoneWindow.preparePanel(PhoneWindow.java:648)
                                                                                 at com.android.internal.policy.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:1029)
                                                                                 at com.android.internal.policy.PhoneWindow$1.run(PhoneWindow.java:341)
                                                                                 at android.os.Handler.handleCallback(Handler.java:739)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                 at android.os.Looper.loop(Looper.java:158)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:7231)
                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
  </code></pre>
  
  <p>Why this error comes i am confused.Any help...</p>