将此https://github.com/vimeo/vimeo-networking-java用于vimeo video player.using compile
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
答案 0 :(得分:3)
您需要初始化VimeoClient
课程。您可以在README。
您需要使用所需的库构建构建器,然后调用initialize
。
以下是构建器的示例:
Configuration.Builder configBuilder =
new Configuration.Builder(clientId, clientSecret, SCOPE,
testAccountStore, new AndroidGsonDeserializer())
.setCacheDirectory(this.getCacheDir())
然后你在这里静态调用初始化:
VimeoClient.initialize(<your builder here>);