Several developers have reported crashes using SQLCipher either on the iPhone 4.0 or iPad 3.2 simulators. After much investigation, we have determined that this issue only occurs when the Base SDK version on the XCode project is different than the SDK version of the simulator in use:
- When the Base SDK for the project set to 3.2, then you can run and test under the iPad 3.2 simulator
- When the Base SDK is set to 4.0, you can run under the iPhone 4.0 simulator
- If the Base SDK is set to 3.2 you can't run the iPhone 4.0 simulator
- If the Base SDK is set to 4.0 then you can't run the iPad 3.2 simulator
Thus, our recommended workaround is to align the Base SDK on the project any time you switch between simulator versions. I've attached screenshots of the Base SDK project setting I'm referring too.
Technically, this issue appears to be related to an incompatibility that causes at least one low-level system call to fail: in this case, the os_unix.c VFS driver's call to fstatfs causes the crash.
For a minimal demonstration of this behavior, consult this standalone app on github.
All it does is call fstatfs, and it will reliably work when the SDK versions match, but will crash when they differ.
I'll try to file this as a bug with Apple shortly, but for the time being the workaround of setting the Base SDK version seems to be a very reliable and relatively painless way to avoid this issue.
I'm very interested to hear from anyone who has experienced this problem whether equalizing the Base SDK version fixes the issues for you. Please feel free to share your results, and let me know if you have any questions. Thanks!