Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 662
TheModularMind Avatar asked Nov 27 '14 15:11

TheModularMind


2 Answers

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

like image 175
franmontiel Avatar answered Nov 09 '22 03:11

franmontiel


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

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

like image 41
bonnyz Avatar answered Nov 09 '22 02:11

bonnyz