No callback after sqlite3_key when using CocoaPods

Hello @gerald, @nullproduction - if you’re still available to test a configuration, could you please try the following:

  1. Open up the project Build Settings (i.e. the global project settings, not the target)
  2. Locate the Other Linker Flags settings and add the value -framework SQLCipher
  3. Navigate down to the Target Build Settings, and verify that the resolved target-level Other Linker Flags shows the -framework SQLCipher first.
  4. Clean the Project, and rebuild

Please let us know the resulting behavior.

Hello @sjlombardo .
Thank you for the response.
I tried it, and it works fine!
Can you add flag “-framework SQLCipher” in podspec(cocapods)?

Hello @nullproduction The podspec is already resulting in the inclusion of -framework SQLCipher, however, because of your other dependencies the standard sqlite3 library is being linked first. The manual project level change forces SQLCipher up front. To be frank, this isn’t really a supported scenario, and using this approach is a risk. There could be other undefined behavior. Here is a link to some guidance we just published about SQLCipher with XCode 8 and iOS 10, for reference.

Thanks for the suggestion, I’ll try it ASAP (need to re-configure my project). Afterwards I’ll get back to you with the results.

Also @nullproduction; good to hear it’s working with you, gives me hope!

@sjlombardo

It’s working! :tada:

I put SQLCipher first up in the list of pods, but forgot to add the -framework SQLCipher flag before my first run of the project. Funny enough it worked right away. Afterwards I checked my build settings, only to discover that it was already added by Cocoapods :confused:.
I did do an update of Cocoapods (to version 1.1.0 rc.2) beforehand, don’t know if it has anything to do with it though. But whatever the case may be, I’m glad it’s working now.

Thanks for helping @sjlombardo (and everyone else)! I hope others with the same problem find this thread and the solution.

And…I’m back again, seems the problem is back. Everything worked fine until I was finally ready for a release of my app.
I tested my app on an iPhone 5 (and 5s) with iOS 8.4, and it seems to hang on the exact same spot.

But…

Now the app actually crashes with the error:

dyld`dyld_fatal_error:
->  0x1fe9a08c <+0>: trap   
    0x1fe9a090 <+4>: nop    

Any insights?

Edit:

I’ve read the new post about Xcode 8 and iOS 10 and verified that -framework SQLCipher is first up in the list

@gerald I don’t have any other specific suggestions. If you can reproduce this in a standalone reference application we might be able to take another look.

@sjlombardo Ah sorry, I forgot to edit my last reply.

I’ve fixed the problem, it was again the fact that -framework SQLCipher wasn’t first up in the list (as you’ve said in your iOS 10 * Xcode 8 post).

For the sake of others who might have the same problem; please check the CocoaPods-generated xcconfig files. It seems that, even though you specify SQLCipher as the first pod, it won’t be the first flag in the OTHER_LD_FLAGS setting of the generated xcconfig file. This is especially the case if you use multiple schemes (as I do).

And again, please don’t go through the same headache-loops as me; be sure to double check the generated xcconfig files!

@sjlombardo, thanks for taking the time to help me every time.