couchbaselabs / ToDoLite-iOS

To-Do list sample app for Couchbase Lite, native iOS version
85 stars 41 forks source link

error getting database Error Domain=SQLite Code=1 "no such module: fts4" UserInfo=0x7fdc0ae21de0 {NSLocalizedDescription=no such module: fts4} #37

Open liufsd opened 9 years ago

liufsd commented 9 years ago

HI,i have clone your project and run success. and then i add this library to my project :https://www.zetetic.net/sqlcipher/ios-tutorial/ But it will exit. code here: CBLManager manager = [CBLManager sharedInstance]; NSError error; self.database = [manager databaseNamed:@"recite_db" error:&error]; if (error) { NSLog(@"error getting database %@",error); exit(-1); } log here:

2014-11-25 18:34:30.039 Recite_IOS[92671:434274] Error calling sqlite3_step (1: no such module: fts4) SQLITE_ERROR 2014-11-25 18:34:30.040 Recite_IOS[92671:434274] DB Query: CREATE VIRTUAL TABLE fulltext USING fts4(content, tokenize=unicodesn) 18:34:30.041| WARNING: CBLDatabase: Could not initialize schema of /Users/liupeng/Library/Developer/CoreSimulator/Devices/50A64A93-FFA7-41A5-8C14-004429011B37/data/Containers/Data/Application/DA116901-9C14-4CD1-841D-F98D8090D89A/Library/Application Support/CouchbaseLite/recite_db.cblite -- May be an old/incompatible format. SQLite error: no such module: fts4 2014-11-25 18:41:19.384 Recite_IOS[92671:434274] error getting database Error Domain=SQLite Code=1 "no such module: fts4" UserInfo=0x7fdc0ae21de0 {NSLocalizedDescription=no such module: fts4}

(you can clone this project :https://github.com/79144876/SQLCipher-iOS.git,and add couchbase: for test.) I guess,may be at this time your couchbase call the sqlite is SQLCipher's custom sqlite.so.may be not support ,and then crash. if right.how to fix it ?(couchbase and SQLCipher in same project.) thanks.

snej commented 9 years ago

Look at the error: it says "no module fts4". CBL needs that SQLite module. You'll need to build sqlcipher with it.=

liufsd commented 9 years ago

Yes. i have try add a new flag -DSQLITE_ENABLE_FTS4 flag within the Other C Flags of the project at last night. but it look like not working also.i will fix it by myself today. Thanks.

liufsd commented 9 years ago

I have post my code here:https://github.com/79144876/CouchbaseQuery And also question here:https://github.com/sqlcipher/sqlcipher/issues/102#event-198275100 Maybe you can help me. Thanks.