Issues on using ForestDB as engine on Android


#1

Hi,

New to Couchbase I referred to the samples to help me get started, used ForestDB as Storage Engine and the Android RecyclerView Animation Example on Github to help load a recyclerview.

The code below kept crashing on me

List<Place> places = new ArrayList<>(); for (Iterator<QueryRow> it = rows; it.hasNext(); ) { QueryRow row = it.next(); Log.d(TAG, "ROW VALUE: " + row.getValue().toString()); Map<String, Object> properties = database.getDocument(row.getDocumentId()).getProperties(); places.add(new Place((LazyJsonObject) row.getValue())); }

with the following error

Java.util.LinkedHashMap cannot be cast to com.couchbase.lite.support.LazyJsonObject

Actually download the Android RecyclerView example and was annoyed when it worked, the only difference is the ForestDB Storage Engine Option, I changed the example to use ForestDB and it crashed, removed ForestDB from my App and it worked. I like the fact I have a list of objects to refer too, especially as my app currently has 3 recyclerview stacked on top of each other, clicks in each filters the next recyclerview.

Information or a tip for newbies such as myself, either way thanks and keep up the excellent work,

Jacko