1

While integrating SQLCipher with cocoapods I’m getting multiple redefinition errors.

Version: 4.5.2

<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:723:8: error: redefinition of 'sqlite3_file'
struct sqlite3_file {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:735:8: note: previous definition is here
struct sqlite3_file {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:822:8: error: redefinition of 'sqlite3_io_methods'
struct sqlite3_io_methods {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:834:8: note: previous definition is here
struct sqlite3_io_methods {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:1427:8: error: redefinition of 'sqlite3_vfs'
struct sqlite3_vfs {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:1439:8: note: previous definition is here
struct sqlite3_vfs {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:1724:8: error: redefinition of 'sqlite3_mem_methods'
struct sqlite3_mem_methods {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:1736:8: note: previous definition is here
struct sqlite3_mem_methods {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:6999:8: error: redefinition of 'sqlite3_module'
struct sqlite3_module {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:6885:8: note: previous definition is here
struct sqlite3_module {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7139:8: error: redefinition of 'sqlite3_index_info'
struct sqlite3_index_info {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7025:8: note: previous definition is here
struct sqlite3_index_info {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7142:10: error: redefinition of 'sqlite3_index_constraint'
  struct sqlite3_index_constraint {
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7028:10: note: previous definition is here
  struct sqlite3_index_constraint {
         ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7149:10: error: redefinition of 'sqlite3_index_orderby'
  struct sqlite3_index_orderby {
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7035:10: note: previous definition is here
  struct sqlite3_index_orderby {
         ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7154:10: error: redefinition of 'sqlite3_index_constraint_usage'
  struct sqlite3_index_constraint_usage {
         ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7040:10: note: previous definition is here
  struct sqlite3_index_constraint_usage {
         ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7285:8: error: redefinition of 'sqlite3_vtab'
struct sqlite3_vtab {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7171:8: note: previous definition is here
struct sqlite3_vtab {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7309:8: error: redefinition of 'sqlite3_vtab_cursor'
struct sqlite3_vtab_cursor {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7195:8: note: previous definition is here
struct sqlite3_vtab_cursor {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:7814:8: error: redefinition of 'sqlite3_mutex_methods'
struct sqlite3_mutex_methods {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:7699:8: note: previous definition is here
struct sqlite3_mutex_methods {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:8570:8: error: redefinition of 'sqlite3_pcache_page'
struct sqlite3_pcache_page {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:8445:8: note: previous definition is here
struct sqlite3_pcache_page {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:8735:8: error: redefinition of 'sqlite3_pcache_methods2'
struct sqlite3_pcache_methods2 {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:8610:8: note: previous definition is here
struct sqlite3_pcache_methods2 {
       ^
<module-includes>:2:9: note: in file included from <module-includes>:2:
#import "sqlite3ext.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3ext.h:20:
#include <sqlite3.h>
         ^
/Users/mukeshyadav/Library/Developer/Xcode/DerivedData/MindTickle-buzymtagwbmstehjmknrjcjxuysn/Build/Products/Debug-iphonesimulator/SQLCipher/SQLCipher.framework/Headers/sqlite3.h:8758:8: error: redefinition of 'sqlite3_pcache_methods'
struct sqlite3_pcache_methods {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/usr/include/sqlite3.h:8633:8: note: previous definition is here
struct sqlite3_pcache_methods {
       ^
<unknown>:0: error: could not build Objective-C module 'SQLite3'

I've just added SQLCipher pod in pod file

  pod 'SQLCipher'

Other pods I am using are AWSS3, FirebaseAnalytics, Mixpanel etc.

5
  • I have same issue "Mixpanel" use Sqlite3 that conflict with SQLCipher. Find any soluation? Commented Oct 29, 2022 at 5:53
  • Ya same. I removed Mixpanel and it started working fine. Have contacted mix panel support lets see if I get anything. Commented Nov 1, 2022 at 5:56
  • I copy "sqlite3.h" and "sqlite3.c" file from SQLCipher pod folder and remove all redefine error. then after replace both file in pod dir it working fine. it is temporary solution. Ref:- github.com/BhaumikSurani/iOS-Note/tree/master/… Commented Nov 1, 2022 at 13:21
  • @BhaumikSurani I'm not getting what you're trying to say. You're saying copy both files from pod folder & remove all redefine error?? how exactly you're removing those errors?? Then you're saying replace both files in pod dir right? but with what or which file we need to replace these files? Same thing you're saying in your GitHub page. Please elaborate clearly. Commented Jun 27, 2024 at 10:31
  • 1
    @Suhail i was replace "sqlite3.h" and "sqlite3.c" in /Pods/SQLCipher. you can copy both file from github.com/BhaumikSurani/iOS-Note/tree/master/… i hope it working for you. Commented Jun 27, 2024 at 11:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.