problem with compiling SQLCipher for Android

504 views
Skip to first unread message

MR

unread,
Nov 17, 2013, 9:56:25 PM11/17/13
to sqlc...@googlegroups.com
Hello,

I'm facing problem with compilation of Android SQLCipher on Ubuntu 64b (NDK 9b).
I need to add only one flag to sqlite: -DSQLITE_SOUNDEX 

In attachment I'm sending what I got after running make.

I need this build really ASAP, so apart from helping to solve the problem, I will be REALLY grateful if someone can make 2.2.2 build with this flag for armeabi for me.

Thanks.
MR
log.txt

Nick Parker

unread,
Nov 18, 2013, 9:08:38 AM11/18/13
to sqlc...@googlegroups.com
Hello MR,

Could you try running `make init` within the project root before you
attempt to compile it? You are missing the build.xml file generated
during the initialization process.
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "SQLCipher Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sqlcipher+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
Nick Parker

signature.asc

MR

unread,
Nov 18, 2013, 9:16:33 AM11/18/13
to sqlc...@googlegroups.com
Hi Nick,

Actually i thought init goes well.
I attach output log.

Thanks for your support.
MR
out.txt

Nick Parker

unread,
Nov 18, 2013, 9:36:22 AM11/18/13
to sqlc...@googlegroups.com
Hi MR,

The error message in the build file suggests you may have a different
Android SDK version than I do as it failed to execute `android update
project -p .` on your machine, I don't receive this message when I run
it. Could you try it again by explicitly passing a target argument:

android update project -p . --target 1

After that, try running make again.
> > an email to sqlcipher+...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
> --
> Nick Parker
signature.asc

MR

unread,
Nov 18, 2013, 10:10:42 AM11/18/13
to sqlc...@googlegroups.com
Hi Nick,

Compilation goes a bit futher, but now there is a problem with

[javac] Compiling 44 source files to /home/mr/sqlcipher/android-database-sqlcipher/bin/classes
[javac] /home/mr/sqlcipher/android-database-sqlcipher/src/net/sqlcipher/database/SQLiteDatabase.java:55: error: package com.google.common.collect does not exist
[javac] import com.google.common.collect.Maps;


As I understand there is problem with Guava. Could you please help me with setting this up?
Thanks!
MR
log.txt

Nick Parker

unread,
Nov 18, 2013, 10:15:47 AM11/18/13
to sqlc...@googlegroups.com
Hi MR,

The guava library should be found in the libs directory within the root
of the project: guava-r09.jar. Could you verify that is present?
signature.asc

MR

unread,
Nov 18, 2013, 10:48:44 AM11/18/13
to sqlc...@googlegroups.com
Hi,

There was no guava. I added it manually, as well as jsoup-1.7.2 and commons-codec.
Now problem like in attachment - there's no external/libs catalog.

MR
make.txt

Nick Parker

unread,
Nov 18, 2013, 10:59:22 AM11/18/13
to sqlc...@googlegroups.com
Hi MR,

SQLCipher for Android depends on guava and commons-codec, both of which
have been in the repository for a long time:

https://github.com/sqlcipher/android-database-sqlcipher/tree/master/libs

If you are not seeing those, I am concerned that your initial clone of
the repository failed somewhere. There should be no dependency on
jsoup. Could you re-clone the repository and rerun `make init` checking
for errors such as the android project update we discussed previously?
Once you have done that, try running the build as long as both guava and
commons-codec are present following the initial clone. Thanks!
signature.asc

MR

unread,
Nov 18, 2013, 3:27:58 PM11/18/13
to sqlc...@googlegroups.com
Hi Nick,

Something was messed up with the folder, so I created a new copy. Now I have problem with:

make[1]: Entering directory `/home/mr/sqlcipher3/android-database-sqlcipher/external'
install -p -m644 libs/armeabi/*.so ../obj/local/armeabi/
install: cannot stat `libs/armeabi/*.so': No such file or directory
make[1]: *** [copy-libs-hack] Error 1
make[1]: Leaving directory `/home/mr/sqlcipher3/android-database-sqlcipher/external'

There is no external/libs after make init & make...

MR
log.txt

Nick Parker

unread,
Nov 18, 2013, 3:45:03 PM11/18/13
to sqlc...@googlegroups.com
Hi MR,

Could you try cleaning your environment with `make clean`, then build
again with `make`.
signature.asc

MR

unread,
Nov 18, 2013, 3:59:10 PM11/18/13
to sqlc...@googlegroups.com
Nick,

The same thing, whole log is in attachment.
init.txt
make.txt

Nick Parker

unread,
Nov 18, 2013, 5:04:23 PM11/18/13
to sqlc...@googlegroups.com
Hello MR,

Are you just not seeing any native libraries generated, or are they
simply not located in the libs directory following the build?
signature.asc

MR

unread,
Nov 18, 2013, 5:18:23 PM11/18/13
to sqlc...@googlegroups.com
Hi Nick,

That's all I got:

mr@ubuntu:~/sqlcipher3/android-database-sqlcipher$ find . -name \*.so
./obj/local/x86/libstlport_shared.so
./obj/local/x86/libsqlcipher_android.so
./obj/local/armeabi/libstlport_shared.so
./obj/local/armeabi/libsqlcipher_android.so
./external/android-libs/x86/libz.so
./external/android-libs/x86/libandroid_runtime.so
./external/android-libs/x86/libbinder.so
./external/android-libs/x86/libutils.so
./external/android-libs/x86/liblog.so
./external/android-libs/x86/libnativehelper.so
./external/android-libs/x86/libcutils.so
./external/android-libs/armeabi/libstlport_shared.so
./external/android-libs/armeabi/libandroid_runtime.so
./external/android-libs/armeabi/libbinder.so
./external/android-libs/armeabi/libutils.so
./external/android-libs/armeabi/liblog.so
./external/android-libs/armeabi/libnativehelper.so
./external/android-libs/armeabi/libcutils.so
./libs/x86/libstlport_shared.so
./libs/x86/libsqlcipher_android.so
./libs/armeabi/libstlport_shared.so
./libs/armeabi/libsqlcipher_android.so
./dist/SQLCipherForAndroid-SDK/libs/armeabi/libstlport_shared.so
./dist/SQLCipherForAndroid-SDK/libs/armeabi/libsqlcipher_android.so
./dist/SQLCipherForAndroid-SDK/libs/armeabi/libdatabase_sqlcipher.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libstlport_shared.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-8.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-9.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-7.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-12.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libdatabase_sqlcipher.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-10.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-11.so
./dist/SQLCipherForAndroid-SDK/samples/notepadbot/libs/armeabi/libsqlcipher_android-13.so


As i understand, wrong path (external/libs) is the problem, am I right?

MR 

Nick Parker

unread,
Nov 18, 2013, 6:05:02 PM11/18/13
to sqlc...@googlegroups.com
Hi MR,

Correct, the makefile will copy over the build output from the
external/libs/${TARGET_PLATFORM} directory into libs/${TARGET_PLATFORM}
with respect to the native libraries. I appears you are missing
libdatabase_sqlcipher.so from within your libs directory.

What version of Ubuntu are you attempting to build this on?
signature.asc

MR

unread,
Nov 18, 2013, 6:08:42 PM11/18/13
to sqlc...@googlegroups.com

Ubuntu 12.10 64-bit

MR

MR

unread,
Nov 21, 2013, 6:10:07 AM11/21/13
to sqlc...@googlegroups.com
Hi Nick,

I've tried with another linux, but same thing. I have no idea what can be wrong.
Can you be so kind and compile v2.2.2 with  -DSQLITE_SOUNDEX if it works for you? I would be grateful.


MR
Reply all
Reply to author
Forward
0 new messages