problem running Android demo app

191 views
Skip to first unread message

Marty Schoch

unread,
Jul 16, 2011, 5:15:17 PM7/16/11
to mobile-c...@googlegroups.com
I'm trying to get up to speed with the Android Couchbase and I'm not
able to get the demo app to run in the emulator. It appears to
extract all the files successfully, and then reports the following
error:

07-16 17:06:25.589: DEBUG/dalvikvm(652): Trying to load lib
/data/data/com.arandomurl.couchapp/lib/libcom_google_ase_Exec.so
0x406436a0
07-16 17:06:25.589: DEBUG/dalvikvm(652): Added shared lib
/data/data/com.arandomurl.couchapp/lib/libcom_google_ase_Exec.so
0x406436a0
07-16 17:06:25.601: DEBUG/dalvikvm(652): No JNI_OnLoad found in
/data/data/com.arandomurl.couchapp/lib/libcom_google_ase_Exec.so
0x406436a0, skipping init
07-16 17:06:25.729: VERBOSE/CouchDB(652):
/data/data/com.arandomurl.couchapp/couchdb/bin/couchdb[42]: basename:
not found
07-16 17:06:25.769: VERBOSE/CouchDB(652):
/data/data/com.arandomurl.couchapp/couchdb/bin/couchdb[333]: can't
create temporary file /sqlite_stmt_journals/mksh.hPJmxX1140: No such
file or directory
07-16 17:06:25.789: VERBOSE/CouchDB(652):
/data/data/com.arandomurl.couchapp/couchdb/bin/couchdb[333]: getopt:
not found
07-16 17:06:25.810: VERBOSE/CouchDB(652): Try ` -h' for more information.
07-16 17:06:25.830: VERBOSE/CouchDB(652):
/data/data/com.arandomurl.couchapp/couchdb/bin/couchdb: erl: not found
07-16 17:06:25.840: VERBOSE/CouchDB(652): CouchDB has stopped unexpectedly
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652):
java.io.IOException: I/O error
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
org.apache.harmony.luni.platform.OSFileSystem.read(Native Method)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
dalvik.system.BlockGuard$WrappedFileSystem.read(BlockGuard.java:172)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
java.io.FileInputStream.read(FileInputStream.java:208)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
java.io.InputStreamReader.read(InputStreamReader.java:248)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
java.io.BufferedReader.fillBuf(BufferedReader.java:130)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
java.io.BufferedReader.readLine(BufferedReader.java:357)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
com.couchbase.libcouch.CouchProcess$1.run(CouchProcess.java:48)
07-16 17:06:25.889: VERBOSE/CouchAppActivity(652): at
java.lang.Thread.run(Thread.java:1020)

I've put the full log here:

https://gist.github.com/1086794

Thanks,

marty

Marty Schoch

unread,
Jul 18, 2011, 11:35:19 AM7/18/11
to mobile-c...@googlegroups.com
Is it expected that I install something like busybox first? basename
does not appear to be available, and it looks to be required by
.../couchdb/bin/couchdb

marty

Marty Schoch

unread,
Jul 18, 2011, 1:24:02 PM7/18/11
to mobile-c...@googlegroups.com
I hard-coded the startup script to not use basename and I was able to
get couch to start. Several other things are still missing from the
startup script, but they are are not fatal.

07-18 13:14:24.299: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.349: VERBOSE/CouchDB(389): [: permission denied
07-18 13:14:24.359: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.389: VERBOSE/CouchDB(389): [: permission denied
07-18 13:14:24.399: VERBOSE/CouchDB(389): getopt: permission denied
07-18 13:14:24.409: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.409: VERBOSE/CouchDB(389): [: permission denied
07-18 13:14:24.418: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.418: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.428: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.428: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.428: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.448: VERBOSE/CouchDB(389): test: permission denied
07-18 13:14:24.468: VERBOSE/CouchDB(389): sed: permission denied

Has anyone else encountered these problems? Am I missing something
obvious, or heading the wrong direction here?

marty

Matt Adams

unread,
Jul 18, 2011, 1:33:07 PM7/18/11
to mobile-c...@googlegroups.com
On 18/07/11 11:24 AM, Marty Schoch wrote:

> I hard-coded the startup script to not use basename and I was able to
> get couch to start. Several other things are still missing from the
> startup script, but they are are not fatal.

Those are "normal" failures, Marty.

basename was expected to fail and it's failure should not have prevented
you from launching Couch. This leads me to believe that the problem was
something else (I could be completely wrong about this since I've only
given your initial report a cursory look).

Would you please post a diff of the changes that you made? I'm
interested in knowing what you needed to do to get this to work.

Also, what version of Android are you running? Is it a stock
distribution or did you root the phone/install a custom ROM?


Thanks,

Matt
--
Matt Adams
Radical Dynamic
www.radicaldynamic.com

Dale Harvey

unread,
Jul 18, 2011, 1:34:58 PM7/18/11
to mobile-c...@googlegroups.com
Yo Sorry I was just in the middle of replying :)

Noone else that I can see has reported that problem, most of the missing commands are just parsing command line flags (and config files passed via command line)

as you can see the path to erlang is just picked up via

export HOME=/data/data/com.arandomurl.couchapp
export LD_LIBRARY_PATH=$HOME/erlang/erts-5.7.5/bin:$HOME/couchdb/bin:$HOME/couchdb/lib/couchdb/bin
export PATH=$HOME/erlang/bin:$HOME/couchdb/bin:$PATH

You do however have a missing getopt which isnt an error I get, the "-h" output seems to suggest one of the command line calls is going funny, I will look around to see how the basename could have fixed it

I have a fresh device sans busybox to be testing against so will look at that today
Cheers for the debug logs

Dale

P.S This is what my working startup looks like

D/dalvikvm( 1390): Trying to load lib /data/data/com.arandomurl.couchapp/lib/libcom_google_ase_Exec.so 0x462728a0
D/dalvikvm( 1390): Added shared lib /data/data/com.arandomurl.couchapp/lib/libcom_google_ase_Exec.so 0x462728a0
D/dalvikvm( 1390): No JNI_OnLoad found in /data/data/com.arandomurl.couchapp/lib/libcom_google_ase_Exec.so 0x462728a0, skipping init
I/global  ( 1390): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
D/SurfaceFlinger(   98): Layer::requestBuffer(this=0x574398), index=0, pid=1390, w=480, h=800 success
V/CouchDB ( 1390): basename: permission denied
V/CouchDB ( 1390): test: permission denied
I/ActivityManager(   98): Displayed activity com.arandomurl.couchapp/.CouchAppActivity: 258 ms (total 917677 ms)
V/CouchDB ( 1390): [: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): [: permission denied
V/CouchDB ( 1390): getopt: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): [: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): test: permission denied
V/CouchDB ( 1390): sed: permission denied
D/AK8973  (   72): HRET = AKSC_HOF_DSS_START
V/AlarmManager(   98): Adding Alarm{465f3de0 type 2 com.google.android.apps.maps} Dec 13 12:47:09 pm
W/Rosie   (  208): mAddHtcWidgetByOtherActivity = false, mIsOpenSlideWhenLeaveLaunch = true
W/InputManagerService(   98): Ignoring hideSoftInput of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4639c310
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_REQUEST
D/AK8973  (   72): HRET = AKSC_HOF_DSS_COMPLETE
V/CouchDB ( 1390): Apache CouchDB 1.0.2 (LogLevel=debug) is starting.

Marty Schoch

unread,
Jul 18, 2011, 1:50:53 PM7/18/11
to mobile-c...@googlegroups.com
Agree, upon looking closer it's not clear why changing basename fixed anything.

The change I made was to couchdb/bin/couchdb

From:

basename=`basename $0`

To:

basename="couchdb"

Then re-tarred/gzipped, added .jpg extension and dropped into
Android-Demo/assets. Uninstalled previous build, relaunched app.
Something in my tar/gzipping appears to have broken the progress bar
during installtion, but adb logcat shows the files extracting fine.

I'm not working with a real device right now. This is stock Android
SDK I installed on Saturday. The emulator instance I got working is
using SDK version 8. Earlier I discovered that anything newer than 10
would fail to load android_icu.

marty

Marty Schoch

unread,
Jul 18, 2011, 1:54:03 PM7/18/11
to mobile-c...@googlegroups.com
Thanks Dale,

Yeah, based on what you and Matt are saying I'll revert my change and
see if I can debug the system call to start couch.

marty

Marty Schoch

unread,
Jul 18, 2011, 3:14:24 PM7/18/11
to mobile-c...@googlegroups.com
Pretty sure I figured it out.

The release-0.1.tgz.jpg inside of the Android-Demo is old and still
has references to:

export HOME=/data/data/%app_name%/cache

The release-0.1.tgz.jpg in libcouch-android was updated more recently
and correctly points to:

export HOME=/data/data/%app_name%

In my own testing I got these files mixed up as well, which is why I
thought the basename changed fixed things.

marty

Matt Adams

unread,
Jul 18, 2011, 3:35:32 PM7/18/11
to mobile-c...@googlegroups.com
On 18/07/11 01:14 PM, Marty Schoch wrote:

> In my own testing I got these files mixed up as well, which is why I
> thought the basename changed fixed things.

Sounds right to me, Marty. Looks like you've got it figured out!

Dale Harvey

unread,
Jul 18, 2011, 3:46:03 PM7/18/11
to mobile-c...@googlegroups.com
My fault, I will update the demo now, cheers for that

Dale
Reply all
Reply to author
Forward
0 new messages