I ran into this issue recently and it cost me some hair to resolve. Debug releases of my app were working great, but as soon as I tried a TestFlight build they crashed instantly. Crash reports showed the crash was in GRDB and libsqlite3.dylib.
It turns out that if you have multiple libraries using sqlite, it's critical that SQLCipher be linked first.
Since lots of 3rd party libs use sqlite (in my app, I have both MS App Center and Sematext/Logsene), I wonder if it would make sense to note this in the GRDB/SQLCipher docs? I found this info buried in SQLCipher FAQ only after a lot of debugging.
Update (in response to @gwendal.roue):
In fact, the SQLCipher docs state that "an application should never link in other versions of SQLite". Unfortunately, this is unrealistic. In the same doc, they state:
"One way to prevent undefined linking behavior or silent failures is to ensure that SQLCipher is linked into the application first."
The docs outline four ways to do this, depending on your situation, but most users of
GRDB/SQLCipher will simply want to go into Build Settings for their target and edit
Other Linker Flags to make sure that
-framework SQLCipher comes first.