Thanks for the reply. I have cerated a sample project and still I am facing issue with SQLCipher. I have added SQLCipher to the sample project (via https://www.zetetic.net/sqlcipher/ios-tutorial/), and add the sample code which having “sqlite3_key” method. But still I am facing the issue.
Can you please share your Email ID so that I can send my SQLCipher sample project.
Hello @YamunaChebolu - it would be best for you to post your sample project under a permissive open source license up to GitHub, then post the URL here. Thanks!
i had the same Q, i pod install this via pod ‘FMDB/SQLCipher’ , i set the Header Search Path $(PROJECT_DIR)/sqlcipher
but i also says that Implicit declaration of function ‘sqlite3_rekey’ is invalid in C99 ,can u help me ? thanks a lot
Hello @350541732 - When you are using a pod you should not have to set the header search path manually. This was required by a few folks earlier in the thread because they were not using CocoaPods.
In this case, you should remove any manual header search paths. You might even want to manually edit the project.pbxproj file and ensure there are no occurrences of HEADER_SEARCH_PATH present. Most importantly, when you run pod install you should not receive any warnings about the project HEADER_SEARCH_PATH overriding the pod settings.
It’s worth mentioning that I have tested this under XC9, it is working fine, and that every case where this error has come up so far has been the result of improperly configured header search paths.
If you are continuing to have trouble you can post a sample project that reproduces the issue under a permissive open source license up to GitHub, then post the URL here.
@350541732 - this appears to be an issue with CocoaPods with use_framworks!, which disables the creation of header links under Pods/Headers. This makes it impossible for FMDB to resolve the proper sqlite3.h file included with SQLCipher.
In this case you can work around this by using a post_install hook in your podfile to create a link in Pods/Headers/Private which is automatically included in the Header Search Path.
post_install do | installer |
print "SQLCipher: link Pods/Headers/sqlite3.h"
system "mkdir -p Pods/Headers/Private && ln -s ../../SQLCipher/sqlite3.h Pods/Headers/Private"
end
pod 'Alamofire'
pod 'FMDB/SQLCipher'
pod 'MJExtension'
pod 'SVProgressHUD'
pod 'SnapKit', '~> 3.2.0'
pod 'ReachabilitySwift'
pod 'NightNight'
pod 'MJRefresh'
pod 'SDWebImage'
pod 'IQKeyboardManagerSwift'
pod 'FSPagerView'
post_install do | installer |
print "SQLCipher: link Pods/Headers/sqlite3.h"
system "mkdir -p Pods/Headers/Private && ln -s ../../SQLCipher/sqlite3.h Pods/Headers/Private"
abstract_target ‘defaults’ do
pod ‘SQLCipher’, :inhibit_warnings => true
pod ‘FMDB/SQLCipher’, :git => 'https://github.com/ccgus/fmdb’
target 'DB’
target 'Example’
end
post_install do | installer |
print "SQLCipher: link Pods/Headers/sqlite3.h"
system "mkdir -p Pods/Headers/Private && ln -s …/…/SQLCipher/sqlite3.h Pods/Headers/Private"
end
Hi @mezhevikin, is the following the only error output from Xcode?
libc++abi.dylib: terminating with uncaught exception of type NSException
Are there any warnings in the Build log, in particular any related to missing symbols, or warnings during the Link phase?
It might helpful to see your whole Build log, but this can be a little much to paste into the forum here. Could you paste it into a gist at https://gist.github.com and include the link to it in your reply? It should automatically embed nicely.
Nothing stands out as abnormal in the Build log. We were wondering if you might try taking SQLCipher out of the podfile and linking your application against FMDB without SQLCipher, as there could be some other issue with building your project in Xcode 9 that we’re not yet aware of. If you are using sqlite3_key or sqlite3_rekey in your project you’ll want to comment or noop that out temporarily to test a build and run cycle without SQLCipher.
Hi @Steven.H.A sorry to hear it. Without knowing the method you are using to include SQLCipher in your project I can’t offer much help. Please have a look at the following resource, and ensure that the sqlite3.h file for your build of SQLCipher is in your project structure and available through the Header Search Paths setting:
That article summarizes the various ways this can happen and offers several work-arounds and things to check.