Search code examples
javaandroidkotlinyoutubeplayer

YoutubePlayerAPI not working in android 11 and 12


YoutubeplayerAPI is not working in Android 11. After player is successfully initialized, on loadvideo video keeps loading. This issue is present in Xiaomi, Realme, and Oppo devices with Android 11.

Manifest File:

android:usesCleartextTraffic="true"
<queries>
<intent>
<action android:name="com.google.android.youtube.api.service.START" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data
android:host="youtube.com"
android:scheme="https" />
</intent>
</queries>

Error:

E/YouTubeAndroidPlayerAPI: Uncaught exception, log serverside
java.lang.IllegalStateException: TikTok Accounts is not enabled yet.

Solution

  • This was fixed recently in youtube version 17.23.35 (link)