2016-07-22 43 views
1

使用前必須配置編譯java.lang.AssertionError:實例必須使用此<a href="https://github.com/vimeo/vimeo-networking-java" rel="nofollow">https://github.com/vimeo/vimeo-networking-java</a>爲VIMEO視頻player.using在VimeoSdl庫

com.vimeo.networking:vimeo-networking:1.0.1 

中的build.gradle但仍然錯誤

得到錯誤

FATAL EXCEPTION: main 

Process: com.sample.vimeosdkapplication, PID: 2113 

    java.lang.AssertionError: Instance must be configured before use 
    at com.vimeo.networking.VimeoClient.getInstance(VimeoClient.java:94) 
    at com.sample.vimeosdkapplication.MainActivity.<init>(MainActivity.java:28) 
    at java.lang.reflect.Constructor.newInstance(Native Method) 
    at java.lang.Class.newInstance(Class.java:1572) 
    at android.app.Instrumentation.newActivity(Instrumentation.java:1065) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
    at android.app.ActivityThread.access$800(ActivityThread.java:144) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:135) 
    at android.app.ActivityThread.main(ActivityThread.java:5221) 
    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:899) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 
    07-22 16:56:57.000 2113-2120/com.sample.vimeosdkapplication W/art: Suspending all threads took: 10ms 

回答

1

您需要初始化VimeoClient類。您可以在README的這一部分了解如何操作。

您需要使用該庫的選項構建生成器,然後致電initialize

這裏是一個製造商的例子:

Configuration.Builder configBuilder = 
     new Configuration.Builder(clientId, clientSecret, SCOPE, 
           testAccountStore, new AndroidGsonDeserializer()) 
      .setCacheDirectory(this.getCacheDir()) 

然後你靜態調用initialize這裏:

VimeoClient.initialize(<your builder here>); 
相關問題