Search code examples
androidyoutubeandroid-serviceandroid-youtube-api

Android L Youtube API - IllegalArgumentException: Service Intent must be explicit


I know that on L I can only bind services that are declared explicit. In my app I'm currently using Youtube API and when running on devices with L I always get this error

java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.youtube.api.service.START }

How can I fix the problem make Youtube API works also on L ?


Solution

  • It is available a new version of the Youtube API (1.2.1) that fixes this issue. It can be downloaded from here.

    If you need to use the old version for some reason keep reading:

    There is a bug in the Youtube API v1.0.0 in Lollipop. More info here and here.

    As a workaround you can use android:targetSdkVersion="19" in the manifest while maintaining API 21 as build target (You still will be able to make use of the Lollipop API in your project).