Android上的YoutubeService错误

时间:2012-08-13 23:26:08

标签: java android api youtube

无法解决此错误。我需要在libs文件夹中安装Lib文件。

private void GetYTData ()
{

    YouTubeService ytservice = new YouTubeService("AppName",Dev_Key);   
}

The Line

YouTubeService ytservice = new YouTubeService("AppName",Dev_Key);

它给了我以下Log cat错误

threadid=1: thread exiting with uncaught exception (group=0x40a4e1f8)
FATAL EXCEPTION: main
    java.lang.ExceptionInInitializerError
    at com.twistedequations.pixel.enemy.Pixel_Enemy_Videos_Fragments.GetYTData(Pixel_Enemy_Videos_Fragments.java:131)
    at com.twistedequations.pixel.enemy.Pixel_Enemy_Videos_Fragments.access$1(Pixel_Enemy_Videos_Fragments.java:128)
    at com.twistedequations.pixel.enemy.Pixel_Enemy_Videos_Fragments$2.onClick(Pixel_Enemy_Videos_Fragments.java:100)
    at android.view.View.performClick(View.java:3511)
    at android.view.View$PerformClick.run(View.java:14110)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    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:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.ExceptionInInitializerError
    at com.google.gdata.client.Service.<clinit>(Service.java:558)
    ... 14 more
     Caused by: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.copyOf
    at com.google.gdata.wireformats.AltFormat$Builder.setAcceptableTypes(AltFormat.java:399)
    at com.google.gdata.wireformats.AltFormat$Builder.setAcceptableXmlTypes(AltFormat.java:387)
    at com.google.gdata.wireformats.AltFormat.<clinit>(AltFormat.java:49)
    ... 15 more

1 个答案:

答案 0 :(得分:0)

java.lang.NoSuchMethodError: 

您在lib文件夹中的jar似乎不包含任何方法copyOf

如果您在类路径中使用较旧/较新(比您的代码)版本的jar,则可能会发生这种情况。

我建议您查看您用于此服务的jar版本。