E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.youtube.player, PID: 19410
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String com.google.android.apps.youtube.core.utils.y.i()' on a null object reference
at com.google.android.apps.youtube.core.player.AdStatsMacros.a(SourceFile:185)
at com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:481)
at com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:467)
at com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:258)
at com.google.android.apps.youtube.core.player.StatsTracker.a(SourceFile:555)
at com.google.android.apps.youtube.core.player.Director.a(SourceFile:90)
at com.google.android.apps.youtube.core.player.ag.a(SourceFile:1562)
at com.google.android.apps.youtube.core.async.p.a(SourceFile:35)
at com.google.android.apps.youtube.core.async.bm.run(SourceFile:96)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I'm trying to play video using YouTube Android Player API. Even though I have video id, my application gets crashed saying "Unfortunately, Youtube has Stopped." I'm getting videos using below api: https://www.googleapis.com/youtube/v3/search?key=AIzaSyC1pCnqKowxxmITL4YIwsuYi6GEeaOgEtY&channelId=UCMEmNnHT69aZuaOrE-dF6ug&part=snippet,id&order=date&maxResults=20
This is logcat:
Here is code for YoutubePlayerActivity:
Here is code for YouTubeFailureRecoveryActivity :
Please help, thanks.