It was working till 1, June 2023. The project was stable for 5 years. But after upgrading xcode to 14.3.1 getting error “Call to undeclared function ‘sqlite3_rekey’; ISO C99 and later do not support implicit function declarations”.
Is there any workaround? We extremely need any solution. Thank you in advance.
Unfortunately the integration was done long time before I came to the project and we had a lot of releases for these 2 years having SQLCipher integrated, the issue raised after xcode upgrade. I know that the xcode compiler was changed in it’s last version, so the issue is not caused by wrong integration. As far as I can see it’s the source integration.
Unfortunately all the URLS provided are older than June 2023 when xcode changed it’s compiler. It was working in May and we successfully built SQLCipher with May 2023 version of xcode. So the URLS not relevant.
We’ve tested SQLCipher integration with Xcode 14.3.1 both via CocoaPods and by directly building from source and including the sqlite3.c and sqlite3.h files in an Xcode project (Option 1 & 2 from the Community Edition integration instructions). Both work fine without with the warning/error. In both cases the sqlite3_key function should be defined and available in SQLCipher’s variant of the sqlite3.h header (as long as you are defining SQLITE_HAS_CODEC as mentioned in the previously linked integration instructions).
This does indicate that it is an issue with your integration of SQLCipher.
Most likely it is related to one of the two issues mentioned in my previous comment:
Not including/importing SQLCipher’s variant of sqlite3.h
Linking in the standard version of SQLite (either directly or through a transitive dependency) and incorrectly using that instead of SQLCipher
I would recommend reviewing your integration. One suggestion would be to try to start with a vanilla project which includes SQLCipher first, making sure that works properly and then incrementally adding in additional dependencies/code one by one until you can isolate where the issue is occurring.
It is also possible that your previous databases might not have been encrypted properly, if you have access to any previously encrypted databases, I would recommend trying to open them using a tool like DB Browser for SQLite: https://sqlitebrowser.org
As far as I can see it’s the source integration.
If this doesn’t help, could you check and confirm how you’re integrating SQLCipher.
Originally the integration was done by someone before me, so I just followed your steps, removed previously done integration and made a fresh start. It’s weird & surprising it was working all these years with missing sqlite3 in project’s root .
Thank you for your help. You saved my day!