NoSuchMethodError encodeBase64String on an Android Application
Hello.
I'm trying to use the libraries(couchbase-client-1.0.2,spymemcached-2.8.0, etc.) on a mobile android application, and following the starting tutorial, but in my main activity instead a java application, it compiles, but when I'm about to run the app on the emulator or my phone, I got this exception on logcat and my application crashes:
java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String
I don't know if I'm using the library on the right way but it seems that android, internally uses this apache library and it has an older version of the class(Base64) that doesn't contain that method.
Does anyone have an idea how to solve this problem?
As an alone java application, it doesn't throw that exception, and the example is running ok, with some problems on requesting an https URL, but it's another topic problem.
Sorry for my bad english and thanks in advance.
Cheers.
Thank you very much for the answer, the fact is that I obviously am trying to do things in a wrong way, I'm going to try with Couchbase Mobile and let you know if it works.
Thanks again!
Which version of android environment are you running?
Nice, was getting this same issue when working on my android app. Thank god theres an active support forum!
if the apps are not working one of the main reason could be the compatibility issue.. whether the app version of device issue.
Hi,
Before going any further it would help to understand what you're trying to do. Generally speaking the Couchbase Java Client wasn't intended to be used in the Android environment. Typically Couchbase Server is deployed in a firewalled environment and only accessed by an application or application server. So running the client on an Android phone doesn't fit this model.
There is also the Couchbase Mobile project. However, this works with Apache CouchDB and not Couchbase Server. It also uses different client libraries such as Ektorp.
So, if you can provide a little more info about what you're trying to do we can figure out which way you should proceed.
marty