AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME
<p>I am getting this random exceptions on some devices. I wonder what I am doing wrong. Please let me know what more information I can provide for this issue. I am clueless what else I can provide to help make this question more useful. I am getting no hints from my app.</p>

<pre><code>0   java.lang.RuntimeException: Unable to create service com.google.android.gms.cast.framework.media.MediaNotificationService: java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
1   at android.app.ActivityThread.handleCreateService(ActivityThread.java:2474)
2   at android.app.ActivityThread.access$1600(ActivityThread.java:130)
3   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
4   at android.os.Handler.dispatchMessage(Handler.java:99)
5   at android.os.Looper.loop(Looper.java:137)
6   at android.app.ActivityThread.main(ActivityThread.java:4847)
7   at java.lang.reflect.Method.invokeNative(Native Method)
8   at java.lang.reflect.Method.invoke(Method.java:535)
9   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11  at dalvik.system.NativeStart.main(Native Method)
12  Caused by: java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
13  at com.google.android.gms.cast.framework.CastContext.zzbd(Unknown Source)
14  at com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown Source)
15  at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(Unknown Source)
16  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2458)
17  ... 10 more
18  java.lang.IllegalStateException: The fully qualified name of the implementation of OptionsProvider must be provided as a metadata in the AndroidManifest.xml with key com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME.
19  at com.google.android.gms.cast.framework.CastContext.zzbd(Unknown Source)
20  at com.google.android.gms.cast.framework.CastContext.getSharedInstance(Unknown Source)
21  at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(Unknown Source)
22  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2458)
23  at android.app.ActivityThread.access$1600(ActivityThread.java:130)
24  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
25  at android.os.Handler.dispatchMessage(Handler.java:99)
26  at android.os.Looper.loop(Looper.java:137)
27  at android.app.ActivityThread.main(ActivityThread.java:4847)
28  at java.lang.reflect.Method.invokeNative(Native Method)
29  at java.lang.reflect.Method.invoke(Method.java:535)
30  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
31  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
32  at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>Edit - <strong>ManifestFile</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.mcruiseon.buseeta"&gt;


    &lt;!-- For Options menu call support --&gt;
    &lt;uses-permission android:name="android.permission.CALL_PHONE"/&gt;

    &lt;!-- To auto-complete the email text field in the login form with the user's emails --&gt;
    &lt;uses-permission android:name="android.permission.READ_PHONE_STATE"/&gt;
    &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;

    &lt;!-- To auto-complete the email text field in the login form with the user's emails --&gt;
    &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
    &lt;!-- For the background service to run forever --&gt;
    &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;

    &lt;!-- For Current Location on Driver App --&gt;
    &lt;permission
        android:name="${manifestApplicationId}.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/&gt;

    &lt;uses-permission android:name="${manifestApplicationId}.permission.MAPS_RECEIVE"/&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;

    &lt;!-- For QR Code --&gt;
    &lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/&gt;
    &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
    &lt;uses-feature android:name="android.hardware.Camera"/&gt;
    &lt;uses-permission android:name="android.permission.GET_TASKS"/&gt;

    &lt;!-- Google Cloud Messaging --&gt;
    &lt;uses-permission
        android:name="${manifestApplicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature"/&gt;
    &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/&gt;

    &lt;uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/&gt;

    &lt;application
        android:name="com.mcruiseon.buseeta.InitializingApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:theme="@style/AppTheme.NoActionBar"&gt;
        &lt;meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/&gt;

        &lt;meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="${mapsKey}"/&gt;

        &lt;activity
            -- MY ACTIVITIES --
        &lt;/activity&gt;

    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>