18

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 ?

TheModularMind
  • 2,024
  • 2
  • 22
  • 36

4 Answers4

43

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).

franmontiel
  • 1,860
  • 1
  • 16
  • 20
9

*UPDATE*
The new android youtube SDK has been released! No more implicit intent problem:

https://developers.google.com/youtube/android/player/downloads/

singleton
  • 5
  • 2
bonnyz
  • 13,458
  • 5
  • 46
  • 70
0

** UPDATE: 2018.12.06 :: Link below no longer works **
This worked for me with the billing API.

http://blog.android-develop.com/2014/10/android-l-api-21-javalangillegalargumen.html?m=1

singleton
  • 5
  • 2
mraviator
  • 4,034
  • 9
  • 38
  • 51
  • Thanks, but I can't get the intent that cause the error using the Youtube api. Is there a way to modify a class inside the .jar file? – TheModularMind Nov 30 '14 at 18:33
  • I suspect it would be a bit difficult. Your best bet is to contact the author of the .jar, if possible. Good luck! – mraviator Nov 30 '14 at 18:38
0

Just replace the old Youtube Api with Latest Youtube Api Version

shyam
  • 1,084
  • 12
  • 20