Redefinition of module "sqlite3"

Hi

Lately i’ve been having trouble using SQLCipher via GRDB: GitHub - groue/GRDB.swift: A toolkit for SQLite databases, with a focus on application development</ti

It happened when i integrated a new third party dependency to my iOS app.
I got a lot of linker errors - “redefinition of module sqlite3”.

So i stumbled upon this old article from you: Important Advisory: SQLCipher with Xcode 8 and new SDKs

And i indeed found that my new third party dependency has a dependency to Sqlite.

Now i just want to ask here to be sure - is there still no way for me to use SQLCipher, when i have another dependency to Sqlite?

@jesperstrom

Thanks for your interest in SQLCipher and for posting to the SQLCipher discussion forum.

Just to confirm, is it GRDB itself which is including a sqlite3 dependency or is a separate third party library? Could you post your current Podfile (if you’re using Cocoa pods)?

In the Xcode 8 Advisory article you linked there are instructions for how to ensure that SQLCipher is linked first (under Project Setup for Linking). Have you tried those instructions? You’ll want to make sure that SQLCipher is linked before any ${inherited} as well (as that could be linking standard sqlite3).

Note: including SQLCipher in a project which also include standard sqlite3 is considered unsupported. While the above recommendations may work, we don’t provide direct support for it.

I’d also recommend using the rest of the recommendations from that article (Runtime check/Testing & Verification).

Here’s an example of someone who was using Google-Mobile-Ads-SDK in conjunction with SQLCipher and used the recommendations the article you linked which worked for them: Cannot open encrypted database with SQLCipher 4 - #4 by mmoore

If you’re unable to get this to work, I’d recommend trying to simplify which pods are conflicting and creating an example project which displays the issue, uploading it to GitHub and posting it here for review.

Note: We (Zetetic) don’t develop or maintain GRDB

Hi.

First of all - i know you don’t develop GRDB, just wanted to say that, in case you knew of any problems with GRDB specifically.

It is not GRDB itself - it’s a new third party library, that i have to include to my app.
The new library is not a Cocoapod dependency but an embedded framework.
Ive been using GRDB with SQLCipher for a long time with no problems.

My podfile looks like this:

# SQlite wrapper library + encryption library
pod 'GRDB.swift/SQLCipher'
pod 'SQLCipher', '~> 4.0'

From what i understood from the article, it was a total no-go to include other dependencies to sqlite3:

“Please note that we DO NOT SUPPORT using SQLCipher with a project that includes a separate sqlite3 dependency, including via CocoaPods. That sort of configuration carries multiple inherent risks, including undefined behavior, deadlocks, loss of data, loss of encryption functionality, etc.”

So i just wanted to know, if it was still not recommended to do - but from what you are saying, it might be okay to do anyway, if you make the right configurations for the project?

@jesperstrom

First of all - i know you don’t develop GRDB, just wanted to say that, in case you knew of any problems with GRDB specifically.

Absolutely. I just wanted to put that note out there publicly in my response to clarify that it’s not a project that we develop/maintain. I’m not aware of any reported issues with GRDB/SQLCipher (I just tried a vanilla cocoa pods project with GRDB/SQLCipher subspec and it appears to be working for me).

So i just wanted to know, if it was still not recommended to do - but from what you are saying, it might be okay to do anyway, if you make the right configurations for the project?

Correct. While we don’t directly support including SQLCipher in a project which also includes standard sqlite3, it’s possible to get it to work (using the recommendations above to ensure that SQLCipher is linked first). The disclaimer implies that we won’t help troubleshoot or support any applications which link both, so you’re “on your own” if you decide to include both SQLCipher and sqlite3.

Thank you for clarifying that.
And thank you for the quick response.