'ExoPlayer Runtime Exception

I am getting following crash continuously in my crash analytics:

Unable to start service AudioPlayerService with Intent { act=android.intent.action.MEDIA_BUTTON flg=0x10000010 AudioPlayerService (has extras) }: java.lang.NullPointerException: uriString.

I have been tested in different devices with different OS , I am able to play Audio in while app is in background or foreground. Can you please guide me? I am using Exo player for playing Audio in my app.

I have been declared following in AndroidManifest:

 <service android:name=".audioplayer.AudioPlayerService">
        <intent-filter>
            <action android:name="android.intent.action.MEDIA_BUTTON" />
            <action android:name="android.media.browse.MediaBrowserService" />
        </intent-filter>
    </service>

    <receiver android:name="androidx.media.session.MediaButtonReceiver">
        <intent-filter>
            <action android:name="android.intent.action.MEDIA_BUTTON" />
        </intent-filter>
    </receiver>

My ExoPlayer dependency is:

implementation 'com.google.android.exoplayer:exoplayer:2.16.0'

implementation 'com.google.android.exoplayer:extension-mediasession:2.16.0'



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source