This is the library that I'm using: https://github.com/clickntap/Vimeo
I'm trying to use the library for an Android app. My test device is Kitkat (4.4.4).
Here's my gradle config:
compileSdkVersion 25
buildToolsVersion "25.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "my.app.package"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0.0-alpha"
}
Here's how I added the library:
compile 'com.clickntap:vimeo:1.10'
But I receive the following error on Vimeo.addVideo()
:
java.lang.NoClassDefFoundError: org.apache.http.impl.client.HttpClientBuilder
and warnings:
WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for debug as it may be conflicting with the internal version provided by Android.
WARNING: Dependency org.json:json:20140107 is ignored for debug as it may be conflicting with the internal version provided by Android.
So I searched a little and found that I could do something like this:
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile('com.clickntap:vimeo:1.10') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.json'
}
But now I'm receiving this error still on Vimeo.addVideo()
and can't find any solution:
java.lang.NoSuchMethodError: org.apache.http.entity.FileEntity.<init>
Please help :(
Thanks,
P.S. Here's the stack trace for the 1st scenario:
Caused by: java.lang.NoClassDefFoundError: org.apache.http.impl.client.HttpClientBuilder
at com.clickntap.vimeo.Vimeo.apiRequest(Vimeo.java:218)
at com.clickntap.vimeo.Vimeo.beginUploadVideo(Vimeo.java:122)
at com.clickntap.vimeo.Vimeo.addVideo(Vimeo.java:138)
at my.app.package.VimeoActivity$6.subscribe(VimeoActivity.java:163) // my activity
at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
at io.reactivex.Single.subscribe(Single.java:2702)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:451)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
And here's for the 2nd scenario, where the httpclient-android
is included:
Caused by: java.lang.NoSuchMethodError: org.apache.http.entity.FileEntity.<init>
at com.clickntap.vimeo.Vimeo.apiRequest(Vimeo.java:247)
at com.clickntap.vimeo.Vimeo.uploadVideo(Vimeo.java:126)
at com.clickntap.vimeo.Vimeo.addVideo(Vimeo.java:140)
at my.app.package.VimeoActivity$6.subscribe(VimeoActivity.java:163) // my activity
at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
at io.reactivex.Single.subscribe(Single.java:2702)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:451)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)