Couchbase on Android not starting

251 views
Skip to first unread message

Marty Schoch

unread,
Nov 5, 2011, 8:28:17 PM11/5/11
to mobile-c...@googlegroups.com
Several people are reporting a similar problem where it appears
Couchbase Mobile is installed correctly, but Couchbase fails to start.
The previous thread was getting hard to follow with some people
reporting success and others still having problems.

If you're running into problems I would recommend the following steps.

1. Try the GrocerySync Applicaiton on a real device. This has the
most recent version of Couchbase Mobile installed. This is known to
work on several devices (though NOT in the emulator).

https://github.com/couchbaselabs/AndroidGrocerySync

2. Use the "adb logcat" command to capture the output when launching
the application.
3. Try and retrieve the CouchDB log file. For grocery sync this can
be found in /mnt/sdcard/Android/com.couchbase.grocerysync/db/couch.log
(the prefix for this path may be different on your device)

If GrocerySync is not working for you, it will help to report the
following information.

- OS
- Eclipse version (if using eclipse)
- Android SDK version
- Device Model and Android OS version

When sending logs, please use a service like pastebin and email the links.

Hopefully we can identify some common element between the users
running into this problem. In parallel we are working on a new build
which will produce more debug output from the CouchDB thread.

marty

Marcelo

unread,
Nov 7, 2011, 5:56:13 PM11/7/11
to Mobile Couchbase
Hi Marty,
Are there any older mobile couchbase versions that work in the Android
emulators that I can download?
I currently don't have a real device to work with, yet I still need to
develop a proof of concept prototype using the emulators.
Thanks,Marcelo

Marty Schoch

unread,
Nov 7, 2011, 6:36:51 PM11/7/11
to mobile-c...@googlegroups.com
I believe all the versions that have been in development since I
started participating in the Android work have used the same version
of spidermonkey with the same compilation settings. So, I don't think
there is any older version you can revert to that will fix the
problem.

However, I finally got around to trying the new ARMv7 support that can
be installed as part of the Android 4.0 (API 14). When I created an
AVD with Target set to API Level 14 and CPU/ABI set to armeabi-v7a I
am able to run GrocerySync.

There are a few caveats though:

- It is incredibly slow. The initial sync takes something like 10
minutes, this is partly because the emulator is slow and partly
because of the number of changes that have to be transferred from
server to client. You can mitigate this by changing the URL it syncs
with to something you have control over.

- Even after all the changes have transferred, the app will get a
socket timeout exception when accessing the view the first time (and
maybe the first few times depending on how many changes were present
when it crashed the first time) I only had to relaunch the app twice.
But eventually CouchDB had the whole view indexed and the view
returns almost immediately. The socket timeout issue is a bug in
GrocerySync that I'll work on shortly.

marty

Srinivasan Kumarasamy

unread,
Nov 7, 2011, 8:53:06 PM11/7/11
to mobile-c...@googlegroups.com
Marty,

I would like run Couchbase on Android 4.0 emulator (ARMv7).

Please provide instructions to build Coucbase for Android 4.0 or shall I follow the same instructions from,


I am also waiting for ARMv6 support and I would like to know when we could get Coucbase for ARMv6 based devices.

Thanks,
Srini

Marty Schoch

unread,
Nov 7, 2011, 9:32:16 PM11/7/11
to mobile-c...@googlegroups.com
Hi Srini,

I did not re-build Couchbase for Android 4.0, I used the existing
release without any problems.

Be sure to select the ARM EABI v7a System Image when updating your
Android installation.
Then create an AVD with Target set to API Level 14 and CPU/ABI set to
armeabi-v7a.
Then launch the application and be sure to select the AVD that supports ARMv7.

I cannot provide you a date when we will add support for ARMv6. We
understand there is demand for this capability and we fully intend to
address this need. There is an issue in JIRA tracking it here:
http://www.couchbase.org/issues/browse/CBMA-13

We are not ignoring the issue, rather we have been focussing on
stabilizing the API first. Adding support for ARMv6 is something that
should be a non-breaking change in the near future.

marty

Srinivasan Kumarasamy

unread,
Nov 8, 2011, 12:34:53 AM11/8/11
to mobile-c...@googlegroups.com
Hi Marty,

Thank you for information. I am able to run Couchbase on Android 4.0 emulator.

Thanks,
Srini

David Brown

unread,
Nov 8, 2011, 1:15:37 PM11/8/11
to Mobile Couchbase
Hi Marty,

Thanks for all of your efforts with CouchDB on Android -- very much
appreciated.

If you have a few moments, could you briefly summarize the issues
keeping libmozjs from running on ARM v6 at the moment? We have a few
clients (and programmers, for that matter) who are interested in
seeing CouchDB run on armv6, and we could probably spare some
developer time if it'd be helpful.

Thanks!
--
Dave
> > On Tue, Nov 8, 2011 at 5:06 AM, Marty Schoch <marty.sch...@gmail.com> wrote:
>
> >> I believe all the versions that have been in development since I
> >> started participating in the Android work have used the same version
> >> of spidermonkey with the same compilation settings.  So, I don't think
> >> there is any older version you can revert to that will fix the
> >> problem.
>
> >> However, I finally got around to trying the new ARMv7 support that can
> >> be installed as part of the Android 4.0 (API 14).  When I created an
> >> AVD with Target set to API Level 14 and CPU/ABI set to armeabi-v7a I
> >> am able to run GrocerySync.
>
> >> There are a few caveats though:
>
> >> -  It is incredibly slow.  The initial sync takes something like 10
> >> minutes, this is partly because the emulator is slow and partly
> >> because of the number of changes that have to be transferred from
> >> server to client.  You can mitigate this by changing the URL it syncs
> >> with to something you have control over.
>
> >> -  Even after all the changes have transferred, the app will get a
> >> socket timeout exception when accessing the view the first time (and
> >> maybe the first few times depending on how many changes were present
> >> when it crashed the first time)  I only had to relaunch the app twice.
> >>  But eventually CouchDB had the whole view indexed and the view
> >> returns almost immediately.  The socket timeout issue is a bug in
> >> GrocerySync that I'll work on shortly.
>
> >> marty
>

Marty Schoch

unread,
Nov 8, 2011, 1:33:11 PM11/8/11
to mobile-c...@googlegroups.com
It mostly boils down to packaging and testing at this point.

I have been able to build a version of libmozjs that works on older
devices. There are a couple of issues with this build.

1. It was with a newer version of spidermonkey. So new it actually
introduces other problems we'd rather not solve right now. I'm pretty
sure the configure flags with some minor tweaks will work with the
existing spidermonkey, I just haven't had time to go back and try.

2. We need to update the build process to build 2 separate versions
of libmozjs now. The reason is that when supporting the older
instruction sets we have to disable support for JIT. We expect this
to be a performance hit that not everyone will want to take. So we
would like to be able to build an armv5te version with JIT disabled,
and an armv7 version with JIT enabled. This way the application
developer can choose the right size/space/device-support trade-offs
for their application, more on this in #3

3. We need to update the installer to offer some options:

Default: ARMv7 only version, will be fast and support most devices
Fat: ARMv7 and ARMv5te versions both installed (using right folder
structure Android will load appropriate lib) takes 2x space
Slow: ARMv5te only version, will generally be slower, but will be
compatible with more devices and take up less space

The configure options I used for nspr and spidermonkey are below (NOTE
they won't work out of the box on the older spidermonkey because that
is designed to work with an older NDK)

./configure \
--target=arm-linux-androideabi \
--with-android-ndk=$ANDROID_NDK_ROOT \
--with-android-toolchain=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
\
--enable-strip \
--with-arch=armv5te \
--with-thumb-interwork=no \
--with-thumb=no \
--disable-methodjit \
--disable-tracejit \
--with-soft-float

./configure \
--target=arm-linux-androideabi \
--with-android-ndk=$ANDROID_NDK_ROOT \
--with-android-toolchain=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
\
--with-android-sdk=$ANDROID_SDK_ROOT \
--disable-tests \
--disable-shared \
--enable-static \
--enable-strip \
--enable-endian=little \
--with-arm-kuser \
--enable-threadsafe \
--with-nspr-cflags=-I$(pwd)/../../nsprpub/dist/include/nspr \
--with-nspr-libs="-L$(pwd)/../../nsprpub/dist/lib -lnspr4 -lplc4 -lplds4" \
--with-arch=armv5te \
--with-thumb-interwork=no \
--with-thumb=no \
--disable-methodjit \
--disable-tracejit \
--with-soft-float

It's not a huge task, but if you haven't been building the Android
Couchbase project from source you may sink some time there. But
contributions are always welcome.

marty

Milan Andric

unread,
Nov 8, 2011, 3:31:07 PM11/8/11
to mobile-c...@googlegroups.com
Marty, do you happen to have a unofficial list of CPU architectures that Couchbase Mobile for Android is known to support? From the mailing list I've gathered there is decent support for armv7, is that it? I'm not that familiar with Android and I know this software has been released pretty recently, but figure doesn't hurt to ask such a broad question.

Thanks again,

Milan

Marty Schoch

unread,
Nov 8, 2011, 4:00:31 PM11/8/11
to mobile-c...@googlegroups.com
The various pieces are compiled in a couple of different ways.

Some pieces are compiled directly using the NDK (ndk-build), other
pieces are compiled using a utility script (agcc) which is a wrapper
around the toolchain provided by the NDK, and then spidermonkey has
its own build scripts that directly use the toolchain from the NDK
(but the version of spidermonkey we're currently using depends on an
older version of the NDK).

To my knowledge, spidermonkey is the only component that is
specifically targeting armv7. And in our testing everything except
javascript views works on the older architectures.

marty

Reply all
Reply to author
Forward
0 new messages