youtubeinitializationandroid-youtube-apiandroid-11youtubeplayer

Android 11 YouTubeAndroidPlayerApi not working


I using YouTubeAndroidPlayerApi for Playing YouTube videos it was working good before Android 11 but when i installed System update to Android 11 it's stop working. I'm using OnePlus 8 device i also tested this code in Pixel 2 XL emulator but same error occur. Same code working on or before Android 10.

YouTubeAndroidPlayerApi version : YouTubeAndroidPlayerApi-1.2.2.zip

Error is : enter image description here


Solution

  • As mentioned here, it's because of package visibility on Android 11. you need to add a proper "query" tag to your AndroidMonifest.