YouTubeService has leaked IntentReceiver

Viewed 436

Im trying to add youtube played to app.

version: YouTubeAndroidPlayerApi-1.2.2

Player added in layout as

    <fragment
        android:id="@+id/youtube_video_fragment"
        android:name="com.views.video.YouTubePlayerSupportFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

Also, release player on destroy:

    @Override
    public void onDestroyView() {
    if (youTubePlayer != null) {
        youTubePlayer.release();
    }
    super.onDestroyView();
}

On back action parent removed and I got this logcat error:

E/ActivityThread: Service com.google.android.youtube.api.service.YouTubeService has leaked IntentReceiver acic@3ef7c23 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Service com.google.android.youtube.api.service.YouTubeService has leaked IntentReceiver acic@3ef7c23 that was originally registered here. Are you missing a call to unregisterReceiver()?
    at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:918)
    at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:719)
    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1172)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1152)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1146)
    at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:554)
    at adso.<init>(SourceFile:65)
    at adtf.get(SourceFile:44)
    at anmy.get(SourceFile:10)
    at kqu.r(SourceFile:254)
    at acgu.get(SourceFile:9)
    at anmy.get(SourceFile:10)
    at kqw.a(SourceFile:10)
    at kpg.<init>(SourceFile:21)
    at com.google.android.apps.youtube.embeddedplayer.service.service.jar.ApiPlayerService.<init>(SourceFile:52)
    at com.google.android.apps.youtube.embeddedplayer.service.service.jar.ApiPlayerFactoryService$1.run(SourceFile:10)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Looks like lib internally start YouTubeService and it register receiver but not unregister it. Is anyone has idea how to solve this, or only new version of library with fix can help?

0 Answers
Related