问题
This is the stack trace I get from the device (Sony Xperia Miro), when I try to play a video using the Player API.
This is the stack trace for the error. Any assistance is welcome. The code seems to work fine on some other devices like Galaxy Nexus, Nexus 7 etc.
FATAL EXCEPTION: main
java.lang.NullPointerException
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:461)
at com.google.android.apps.youtube.core.client.DefaultAdStatsClient.h(SourceFile:320)
at com.google.android.apps.youtube.core.player.StatsTracker.g(SourceFile:409)
at com.google.android.apps.youtube.core.player.an.handleMessage(SourceFile:1615)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
回答1:
This was an issue with the native Youtube App. It has been acknowlegded and fixed, in subsequent releases to the Youtube App released by google.
Link here for the same: https://code.google.com/p/gdata-issues/issues/detail?id=5431
来源:https://stackoverflow.com/questions/19597669/youtube-player-api-android-crashes-on-playback-on-some-devices