0

I am trying to integrate the Youtube API into my project. To do so,

  • I have copied the the necessary jar files from the sdk folder to my project
  • Added it to my project build path.
  • I have also obtained a key from google, and added it to the Developer.java file, and it is used at the time of calling the intialize() function.

The program shows no error at build time. However, when it shows the follwing log when I try to initialize. Please help:

06-25 18:26:15.813: E/AndroidRuntime(6197): FATAL EXCEPTION: main
06-25 18:26:15.813: E/AndroidRuntime(6197): java.lang.RuntimeException: Unable to start     activity ComponentInfo{com.deltapath.frSIP/hk.d100.VideoPlayer}: java.lang.IllegalArgumentException: callingAppVersion cannot be null or empty
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.os.Looper.loop(Looper.java:137)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.ActivityThread.main(ActivityThread.java:5041)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at java.lang.reflect.Method.invokeNative(Native Method)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at java.lang.reflect.Method.invoke(Method.java:511)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at dalvik.system.NativeStart.main(Native Method)
06-25 18:26:15.813: E/AndroidRuntime(6197): Caused by: java.lang.IllegalArgumentException: callingAppVersion cannot be null or empty
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.google.android.youtube.player.internal.ac.a(Unknown Source)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.google.android.youtube.player.internal.o.<init>(Unknown Source)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.google.android.youtube.player.internal.ad.a(Unknown Source)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.google.android.youtube.player.YouTubePlayerView.a(Unknown Source)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.google.android.youtube.player.YouTubeBaseActivity$a.a(Unknown Source)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at com.google.android.youtube.player.YouTubePlayerView.initialize(Unknown Source)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at hk.d100.VideoPlayer.onCreate(VideoPlayer.java:42)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.Activity.performCreate(Activity.java:5104)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-25 18:26:15.813: E/AndroidRuntime(6197):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-25 18:26:15.813: E/AndroidRuntime(6197):     ... 11 more
4

1 回答 1

0

如果可能,请包括您对 YouTube API 的使用(而不仅仅是堆栈跟踪),以便其他人可以帮助您。

于 2013-06-25T11:00:28.667 回答