0

このエラーを解決できません。必要なLibファイルをlibsフォルダーにインストールしました。

private void GetYTData ()
{

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

この線

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
4

1 に答える 1

0
java.lang.NoSuchMethodError: 

libフォルダーにあるjarにはメソッドが含まれていないようですcopyOf

これは、クラスパスに (コードよりも) 古い/新しいバージョンの jar がある場合に発生する可能性があります。

このサービスに使用している jar のバージョンを確認することをお勧めします。

于 2012-08-13T23:30:45.937 に答える