react-native-youtube icon indicating copy to clipboard operation
react-native-youtube copied to clipboard

"Get YouTube App" Android 11

Open anthoninCL opened this issue 3 years ago • 5 comments

I've implemented react-native-youtube a long time ago in my app but it seems something has changed with Android 11 (not sure about it).

When I try to launch a video, I get a pop up saying "Get YouTube App. This app won't run without the YouTube App, which is missing from your device". I do have YouTube installed on my device.

Screenshot from 2021-06-02 12-13-06

I ran into this issue on a Samsung Galaxy A70 and even on an emulator, both having API 30.

anthoninCL avatar Jun 02 '21 10:06 anthoninCL

Hi :) The thing is that Android does not allow connections to other apps (like YouTube) by default since Android 11. You have to specify the allowed connection from your app to YouTube via the manifest. More info here: https://stackoverflow.com/questions/63909770/why-youtube-player-api-does-not-work-on-android-11

This info should be added at least to the readme of the react-native-youtube project

martinhellwig avatar Jun 24 '21 12:06 martinhellwig

I'm having the same problem too on both an emulator and a physical device (Amazon Fire Stick). I reviewed the SO post @martinhellwig provided and tried all suggestions but couldn't get anything to work.

c-moyer avatar Jun 26 '21 23:06 c-moyer

The SO solution works. You need to add <queries> <intent> <action android:name="com.google.android.youtube.api.service.START" /> </intent> </queries> before the application tag in manifest file.

OmarBasem avatar Jul 10 '21 17:07 OmarBasem

So, Amazon Fire Sticks don't support this functionality which is why I was receiving the error.

c-moyer avatar Jul 11 '21 03:07 c-moyer

@c-moyer @anthoninCL actually Firestick comes with Youtube tv. If you will notice the Sack overflow solution it is starting intent of "com.google.android.youtube" however the Youtube app you may have in Firestick is "com.google.android.youtube.tv". To fix this. please disable and force stop the Current Youtube you have in firestick. install a apk of youtube from the internet in firestick and then run your app with solution by StackOverFlow. It will work.

rohitsingh2410 avatar Oct 11 '21 13:10 rohitsingh2410