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

4

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 ?

Boutte answered 27/11, 2014 at 15:52 Comment(0)
P
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).

Professionalize answered 30/12, 2014 at 18:20 Comment(2)
It is available a new version of the Youtube API (1.2.1) that fixes this issue.Professionalize
kept crashing at the developer key. this helped.Feudality
H
9

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

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

Handyman answered 23/1, 2015 at 9:26 Comment(0)
R
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

Replete answered 28/11, 2014 at 0:59 Comment(2)
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?Boutte
I suspect it would be a bit difficult. Your best bet is to contact the author of the .jar, if possible. Good luck!Replete
H
0

Just replace the old Youtube Api with Latest Youtube Api Version

Hepsibah answered 29/8, 2018 at 6:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.