Search code examples
iosxcodecocoapodsadobesqlcipher

iOS Project with SQLCipher and SQLite Dependency


How can an iOS project be configured so that it can use the SQLCipher pod and also install 3rd party pods (like the Adobe Mobile SDKs) which use SQLite3?

SQLCipher has a disclaimer that usage with other pods that depend on SQLite3 is not supported, but that it should be possible.

SqlCipher Disclaimer

The guide to do this configuration consists of configuring the linking order in Xcode. Attempts at doing this have been unsuccessful:

Redefinition of sqlite3_file error message

A reproduction of the issue and attempted fix is available here: https://github.com/Chuckv01/adobe-sqlcipher-issue-reproduction


Solution

  • Fix this Redefinition of 'sqlite3_file' error by adding three Preprocessor Macros to the app Target in Xcode:

    • _SQLITE3_H_=1
    • _FTS5_H=1
    • _SQLITE3RTREE_H_=1

    Do this for the Debug and Release environments. Ensure previous macros are preserved and not deleted.

    Configure Preprocessor Macros

    Diff of changes:

    Diff of changes