Error building android-sqlcipher-spatialite

1,119 views
Skip to first unread message

Svetlozar Kostadinov

unread,
Jul 31, 2013, 9:08:25 AM7/31/13
to sqlc...@googlegroups.com
Hello! I have this error.... Any ideas what is the reason?

ubuntu@ubuntu-VirtualBox:/media/sf_repo/android-sqlcipher-spatialite$ make
cd /media/sf_repo/android-sqlcipher-spatialite/external && \
make -f Android.mk build-local-hack && \
ndk-build && \
make -f Android.mk copy-libs-hack
make[1]: Entering directory `/media/sf_repo/android-sqlcipher-spatialite/external'
make[1]: Nothing to be done for `build-local-hack'.
make[1]: Leaving directory `/media/sf_repo/android-sqlcipher-spatialite/external'
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icui18n: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icui18n: non-system libraries in linker flags: -lpthread    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icuuc: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icuuc: non-system libraries in linker flags: -lpthread    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher: LOCAL_LDFLAGS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher: non-system libraries in linker flags: -lcrypto    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher_android: non-system libraries in linker flags: -lutils -lcutils -lcrypto    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
make[1]: Entering directory `/media/sf_repo/android-sqlcipher-spatialite/external'
/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:16: warning: overriding commands for target `sqlcipher/sqlite3.c'
/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:16: warning: ignoring old commands for target `sqlcipher/sqlite3.c'
/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:20: warning: overriding commands for target `copy-libs-hack'
/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:20: warning: ignoring old commands for target `copy-libs-hack'
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icui18n: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icui18n: non-system libraries in linker flags: -lpthread    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icuuc: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:icuuc: non-system libraries in linker flags: -lpthread    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher: LOCAL_LDFLAGS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher: non-system libraries in linker flags: -lcrypto    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Android NDK: WARNING:/media/sf_repo/android-sqlcipher-spatialite/external/Android.mk:sqlcipher_android: non-system libraries in linker flags: -lutils -lcutils -lcrypto    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
Compile++ thumb  : sqlcipher_android <= sqlite3_android.cpp
In file included from /media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:30:0:
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:26:32: error: 'sqlite3' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:26:42: error: 'handle' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:26:50: error: expected primary-expression before 'int'
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:26:66: error: expression list treated as compound expression in initializer [-fpermissive]
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:28:34: error: 'sqlite3' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:28:43: error: 'handle' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:28:51: error: expected primary-expression before 'const'
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:28:77: error: expected primary-expression before 'int'
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.h:28:93: error: expression list treated as compound expression in initializer [-fpermissive]
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:80:5: error: variable or field 'get_phonebook_index' declared void
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:80:5: error: 'sqlite3_context' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:80:23: error: 'context' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:80:32: error: expected primary-expression before 'int'
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:80:42: error: 'sqlite3_value' was not declared in this scope
/media/sf_repo/android-sqlcipher-spatialite/external/android-sqlite/android/sqlite3_android.cpp:80:59: error: 'argv' was not declared in this scope
make[1]: *** [/media/sf_repo/android-sqlcipher-spatialite/obj/local/armeabi/objs/sqlcipher_android/android-sqlite/android/sqlite3_android.o] Error 1
make[1]: Leaving directory `/media/sf_repo/android-sqlcipher-spatialite/external'
make: *** [build-external] Error 2
ubuntu@ubuntu-VirtualBox:/media/sf_repo/android-sqlcipher-spatialite$ 

Nick Parker

unread,
Jul 31, 2013, 9:14:29 AM7/31/13
to sqlc...@googlegroups.com
Hi Svetlozar,

It looks like you are trying to build SpatiaLite using SQLCipher for Android.  I am not familiar with SpatiaLite, could you share what modifications you have made to the stock SQLCipher for Android source?

Nick Parker



--
 
---
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.
 
 

Alexey Illarionov

unread,
Jul 31, 2013, 1:31:31 PM7/31/13
to sqlc...@googlegroups.com
Hi,

android-database-sqlcipher build is broken with recently released android-ndk-r9.
Ndk r8e works fine.

среда, 31 июля 2013 г., 17:14:29 UTC+4 пользователь Nick Parker написал:

Billy Gray

unread,
Jul 31, 2013, 2:21:58 PM7/31/13
to sqlc...@googlegroups.com
Alexey, 

If you want help you need to take the time to show us what your doing, some command listings, things you modified, etc. 

B


--
 
---
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.
 
 



--
Team Zetetic
http://zetetic.net

Nick Parker

unread,
Jul 31, 2013, 2:39:00 PM7/31/13
to sqlc...@googlegroups.com
Hi Alexey,

I was just able to build SQLCipher for Android using the latest r9 NDK release on OSX.  What environment are you building on?  What errors do you receive?

Nick Parker


--

Alexey Illarionov

unread,
Jul 31, 2013, 7:04:59 PM7/31/13
to sqlc...@googlegroups.com


среда, 31 июля 2013 г., 22:39:00 UTC+4 пользователь Nick Parker написал:
Hi Alexey,

I was just able to build SQLCipher for Android using the latest r9 NDK release on OSX.  What environment are you building on?  What errors do you receive?


 Ubuntu 13.0 x86_64, android-ndk-r9 x86_64.

Tried to compile current git master on clean enviroment with the same result:

SharedLibrary  : libsqlcipher_android.so
Install        : libsqlcipher_android.so => libs/x86/libsqlcipher_android.so
Install        : libstlport_shared.so => libs/x86/libstlport_shared.so
make[1]: Leaving directory `/home/alexey/android-database-sqlcipher/external'
make[1]: Entering directory `/home/alexey/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/alexey/android-database-sqlcipher/external'

full log: http://ls.0xdc.ru/sqlcipherndkv9.log

For now I fixed this bug by rewriting build system using import-module's: https://github.com/illarionov/android-sqlcipher-spatialite/commit/82d90eba7bdc31a58b8a37c47da392ecd7717f63


Michele Mondelli

unread,
Aug 1, 2013, 9:23:57 AM8/1/13
to sqlc...@googlegroups.com
Hi all.

For me, the process hung up with this error: http://pastebin.com/Y0usveKP

My system is Linux ldp039 3.9-1-amd64 #1 SMP Debian 3.9.8-1 x86_64 GNU/Linux with android-ndk-r8d.


Regards,

Nick Parker

unread,
Aug 2, 2013, 9:24:07 AM8/2/13
to sqlc...@googlegroups.com
Thanks - we will look into the build process on Linux and report back.

Nick Parker


--

Michele Mondelli

unread,
Aug 7, 2013, 8:27:42 AM8/7/13
to sqlc...@googlegroups.com
I've updated my adt & ndk tools to the last release, and now the compilation goes pretty well!

What if I want to compile also che binary executable for linux of sqlcipher with spatialite support?

Thanks

Nick Parker

unread,
Aug 8, 2013, 10:34:06 AM8/8/13
to sqlc...@googlegroups.com
Hi Michele,

Thanks for getting back to us with the status of your build using the latest NDK.  As I mentioned, I am unfamiliar with spatialite, however you may find the steps to building SQLCipher on Linux helpful along the way:


Nick Parker

Michele Mondelli

unread,
Aug 13, 2013, 9:17:56 AM8/13/13
to sqlc...@googlegroups.com
Hi. 

I've been able to compile the sqlcipher contained in android-sqlcipher-spatialite/ndk-modules/sqlcipher/sqlcipher, but it doesn't have any spatial extensions.
First time I've compiled it with the instructions contained on http://sqlcipher.net/introduction/ .
The second time I've taken the configure options from the file Android.mk found in android-sqlcipher-spatialite/ndk-modules/sqlcipher/, and added some other options to make it work. The complete configure command is like following:

./configure CFLAGS="-DHAVE_USLEEP=1 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 -DSQLITE_THREADSAFE=1 \
-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_BACKWARDS \
-DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_ICU -DSQLITE_ENABLE_RTREE \
-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto -licuuc -licudata -licuio -licui18n" --enable-tempstore=yes

What I'm doing wrong? 
Has anyone compiled sqlcipher executable with spatialite support?

Regards,
 Michele

Alexey Illarionov

unread,
Aug 13, 2013, 10:30:22 AM8/13/13
to sqlc...@googlegroups.com
Hi,

вторник, 13 августа 2013 г., 17:17:56 UTC+4 пользователь Michele Mondelli написал:
Hi. 
Has anyone compiled sqlcipher executable with spatialite support?
libspatialite can be build as dynamic extension of sqlcipher, something like this: https://gist.github.com/illarionov/6221523

$ sqlcipher test.sqlite
SQLite version 3.7.14.1 2012-10-04 19:37:12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .load 'libspatialite.so'
sqlite> select spatialite_version();
4.1.1
sqlite> select geos_version();
3.3.3-CAPI-1.7.4
sqlite> select proj4_version();
Rel. 4.7.1, 23 September 2009


Michele Mondelli

unread,
Aug 13, 2013, 11:12:26 AM8/13/13
to sqlc...@googlegroups.com
Great, it works!
Compiling libspatialite autoreconf give an error. I've compiled it without any special flag, and it works good.

Thank you man!

Michele Mondelli

unread,
Aug 13, 2013, 11:30:52 AM8/13/13
to sqlc...@googlegroups.com
... or maybe not ....

sqlite> SELECT AddGeometryColumn('a','the_geom',4326,'POINT','XY');
AddGeometryColumn() error: unexpected metadata layout

Sorry Alexey, can you test if for you AddGeometryColumn works?

Thanks

Michele Mondelli

unread,
Aug 13, 2013, 11:41:55 AM8/13/13
to sqlc...@googlegroups.com
Sorry, my fault. 
Missing "SELECT InitSpatialMetaData()" :)

Michele Mondelli

unread,
Sep 9, 2013, 7:10:43 AM9/9/13
to sqlc...@googlegroups.com
Hi,

for you SpatialIndex works?

I have the follow error:

sqlite> SELECT CreateSpatialIndex('testtable', 'the_geom');
updateTableTriggers: "no such module: rtree"
1




Il giorno martedì 13 agosto 2013 16:30:22 UTC+2, Alexey Illarionov ha scritto:
Reply all
Reply to author
Forward
0 new messages