# Youtube Video Player not working on Android

**URL:** <https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804>\
**Category:** Ionic Native\
**Created:** [February 17, 2018, 6:32pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804 "2018-02-17T18:32:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![creacht](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/creacht/32/88099_2.png) [@creacht](https://forum.ionicframework.com/u/creacht)\
**Post date:** [February 17, 2018, 6:32pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/1 "2018-02-17T18:32:58Z")

</div>

Hello everyone,

The plugin located here seems to not work for me on Android :

> **[Ionic Framework](https://ionicframework.com/docs/native/youtube-video-player/)**
>
> Ionic is the app platform for web developers. Build amazing mobile, web, and desktop apps all with one shared code base and open web standards

Indeed,  
the plugin works fine on iOS, but I cannot launch the app in my Android Studio …

My config :

```auto
Installed platforms:
  android 7.0.0
  ios 4.5.4

```

I installed the plugin :

```auto
ionic cordova plugin add cordova-plugin-youtube-video-player
npm install --save @ionic-native/youtube-video-player

```

And for information, I added the plugin **in my app module**.

`ionic cordova build android` is working, but when I try to “ **Make Project** ” on **Android Studio**  **it failed** :

```auto
[...my path ...]/platforms/android/app/src/main/java/com/bunkerpalace/cordova/YoutubeVideoPlayer.java
Error:(13, 41) error: package com.google.android.youtube.player does not exist
Error:(14, 25) error: package com.keyes.youtube does not exist
Error:(53, 21) error: cannot find symbol variable YouTubeIntents
Error:(54, 38) error: cannot find symbol variable YouTubeIntents
Error:(55, 14) error: cannot find symbol variable YouTubeIntents
Error:(57, 8) error: cannot find symbol variable YouTubeIntents
Error:(58, 15) error: cannot find symbol variable YouTubeIntents
Error:(71, 81) error: cannot find symbol class OpenYouTubePlayerActivity

Second part of errors : 
[...]/platforms/android/app/src/main/java/com/bunkerpalace/cordova/YouTubeActivity.java 
Error:(7, 41) error: package com.google.android.youtube.player does not exist
Error:(8, 41) error: package com.google.android.youtube.player does not exist
Error:(9, 41) error: package com.google.android.youtube.player does not exist
Error:(10, 55) error: package com.google.android.youtube.player.YouTubePlayer does not exist
Error:(11, 41) error: package com.google.android.youtube.player does not exist
Error:(12, 55) error: package com.google.android.youtube.player.YouTubePlayer does not exist
Error:(14, 38) error: cannot find symbol class YouTubeBaseActivity
Error:(14, 82) error: package YouTubePlayer does not exist
Error:(15, 9) error: cannot find symbol class PlayerStateChangeListener
Error:(18, 13) error: cannot find symbol class YouTubePlayerView
Error:(34, 41) error: cannot find symbol class Provider
Error:(34, 60) error: cannot find symbol class YouTubePlayer
Error:(42, 41) error: cannot find symbol class Provider
Error:(42, 60) error: cannot find symbol class YouTubeInitializationResult
Error:(59, 60) error: package com.google.android.youtube.player.YouTubePlayer does not exist
Error:(22, 5) error: method does not override or implement a method from a supertype
Error:(24, 9) error: cannot find symbol variable super
Error:(25, 25) error: cannot find symbol method getIntent()
Error:(28, 27) error: cannot find symbol class YouTubePlayerView
Error:(33, 5) error: method does not override or implement a method from a supertype
Error:(41, 5) error: method does not override or implement a method from a supertype
Error:(47, 18) error: no suitable method found for makeText(YouTubeActivity,String,int)
method Toast.makeText(Context,CharSequence,int) is not applicable
(argument mismatch; YouTubeActivity cannot be converted to Context)
method Toast.makeText(Context,int,int) is not applicable
(argument mismatch; YouTubeActivity cannot be converted to Context)
Error:(51, 5) error: method does not override or implement a method from a supertype
Error:(53, 19) error: cannot find symbol variable RESULT_OK
Error:(54, 9) error: cannot find symbol method finish()
Error:(57, 5) error: method does not override or implement a method from a supertype
Error:(61, 9) error: cannot find symbol method finish()
Error:(64, 5) error: method does not override or implement a method from a supertype
Error:(67, 5) error: method does not override or implement a method from a supertype
Error:(70, 5) error: method does not override or implement a method from a supertype
Error:(73, 5) error: method does not override or implement a method from a supertype

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Information:BUILD FAILED in 16s
Information:40 errors
Information:0 warnings

```

I really don’t know what to do with that,  
Did anyone have this kind of troubles with the plugin ?

Thank you very much !

Théo.

---

<div class="post-metadata">

**Author:** ![jamesharvey](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jamesharvey/32/116080_2.png) [@jamesharvey](https://forum.ionicframework.com/u/jamesharvey)\
**Post date:** [February 17, 2018, 6:36pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/2 "2018-02-17T18:36:39Z")

</div>

try Videogular 2

> **[videogular2](https://www.npmjs.com/package/videogular2)**
>
> Videogular is a video application framework for desktop and mobile powered by Angular

---

<div class="post-metadata">

**Author:** ![jylikorpi](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jylikorpi](https://forum.ionicframework.com/u/jylikorpi)\
**Post date:** [March 10, 2018, 7:11pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/3 "2018-03-10T19:11:12Z")

</div>

Just the apposite. Works on Android, but not working on iOS. Can’t even get a decent error message from iOS ☹ Just doesn’t work. Doesn’t do anything, when opening a link to video.

---

<div class="post-metadata">

**Author:** ![lancwl418](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@lancwl418](https://forum.ionicframework.com/u/lancwl418)\
**Post date:** [April 2, 2018, 5:57am UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/4 "2018-04-02T05:57:26Z")

</div>

Got the same error. Have you fixed it?

---

<div class="post-metadata">

**Author:** ![creacht](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/creacht/32/88099_2.png) [@creacht](https://forum.ionicframework.com/u/creacht)\
**Post date:** [April 3, 2018, 12:40pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/5 "2018-04-03T12:40:18Z")

</div>

No wasn’t able to fix it …  
I decided to use **InAppBrowser** for now.  
It work well but if I succeed to do it I’ll tell you !

---

<div class="post-metadata">

**Author:** ![DanielAccorsi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/danielaccorsi/32/118112_2.png) [@DanielAccorsi](https://forum.ionicframework.com/u/DanielAccorsi)\
**Post date:** [April 3, 2018, 1:03pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/6 "2018-04-03T13:03:09Z")

</div>

> [@creacht](#):
>
> I decided to use InAppBrowser for now.

The information of native plugin says: “_Plays YouTube videos in Native YouTube App_”.  
Now, only one simple (and stupid) question, did you try update your YouTube app? Considering that the ionic uses it for playing vídeos.

_Other explanation: the native plugin is not updated to use updated Youtube app, **open issue** about this._

---

<div class="post-metadata">

**Author:** ![creacht](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/creacht/32/88099_2.png) [@creacht](https://forum.ionicframework.com/u/creacht)\
**Post date:** [April 3, 2018, 1:17pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/8 "2018-04-03T13:17:20Z")

</div>

Not a stupid question at all, on the contrary,  
At the time I tried to used it, I had everything updated, but it’s definitely something I’ll give a try thanks.  
Tells you if it works… (I’ll try this week I guess)

---

<div class="post-metadata">

**Author:** ![eltigre9](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@eltigre9](https://forum.ionicframework.com/u/eltigre9)\
**Post date:** [September 10, 2018, 11:07pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/9 "2018-09-10T23:07:05Z")

</div>

Has anyone figured this out yet? I ended up [adding this plugin on github](https://github.com/rosses/CordovaYoutubeVideoPlayer.git), which basically is a fork of the original plugin with changes to the plugin.xml file (in the plugin folder). It makes changes to the config tags so that the files are placed in the right folders when it builds.

Works just fine on iOS, but when I attempt to call its video function, I get this error:

```auto
D/PluginManager: exec() call to unknown plugin: YoutubeVideoPlayer

D/SystemWebChromeClient: http://localhost:8080/plugins/cordova-plugin-youtube-video-player/plugins/com.bunkerpalace.cordova.YoutubeVideoPlayer/www/YoutubeVideoPlayer.js: Line 14 : Class not found

I/chromium: [INFO:CONSOLE(14)] "Class not found", source: http://localhost:8080/plugins/cordova-plugin-youtube-video-player/plugins/com.bunkerpalace.cordova.YoutubeVideoPlayer/www/YoutubeVideoPlayer.js (14)

```

Still trying to figure it out myself, but I feel like I’m close.

If anyone has any suggestions, I’m all ears.

Thanks!

---

<div class="post-metadata">

**Author:** ![supakwong](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@supakwong](https://forum.ionicframework.com/u/supakwong)\
**Post date:** [March 2, 2019, 10:09pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/10 "2019-03-02T22:09:39Z")

</div>

waiting to hear update.

---

<div class="post-metadata">

**Author:** ![shurvirhtml](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shurvirhtml/32/128643_2.png) [@shurvirhtml](https://forum.ionicframework.com/u/shurvirhtml)\
**Post date:** [November 15, 2019, 5:58am UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/11 "2019-11-15T05:58:18Z")

</div>

**same problem here bro… if you found solution, then provide to me**

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 8:53pm UTC](https://forum.ionicframework.com/t/youtube-video-player-not-working-on-android/121804/13 "2021-07-19T20:53:53Z")

</div>

Closed on July 19, 2021, 8:53pm UTC


