# No callback after sqlite3\_key when using CocoaPods

**URL:** <https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532>\
**Category:** SQLCipher\
**Created:** [July 18, 2016, 8:58am UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532 "2016-07-18T08:58:59Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [September 14, 2016, 6:30pm UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/21 "2016-09-14T18:30:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nullproduction](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/nullproduction/32/388_2.png) [@nullproduction](https://discuss.zetetic.net/u/nullproduction)\
**Post date:** [September 14, 2016, 7:54pm UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/22 "2016-09-14T19:54:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [September 14, 2016, 9:48pm UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/23 "2016-09-14T21:48:26Z")

</div>

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](https://discuss.zetetic.net/t/important-advisory-sqlcipher-with-xcode-8-and-ios-10/1688), for reference.

---

<div class="post-metadata">

**Author:** ![gerald](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@gerald](https://discuss.zetetic.net/u/gerald)\
**Post date:** [September 15, 2016, 7:12am UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/24 "2016-09-15T07:12:57Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![gerald](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@gerald](https://discuss.zetetic.net/u/gerald)\
**Post date:** [September 15, 2016, 9:47am UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/25 "2016-09-15T09:47:42Z")

</div>

@sjlombardo

It’s working! 🎉

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 😕.  
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.

---

<div class="post-metadata">

**Author:** ![gerald](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@gerald](https://discuss.zetetic.net/u/gerald)\
**Post date:** [September 21, 2016, 1:59pm UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/26 "2016-09-21T13:59:16Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [September 26, 2016, 6:55pm UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/27 "2016-09-26T18:55:45Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![gerald](https://avatars.discourse-cdn.com/v4/letter/g/ea666f/32.png) [@gerald](https://discuss.zetetic.net/u/gerald)\
**Post date:** [September 27, 2016, 7:52am UTC](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532/28 "2016-09-27T07:52:14Z")

</div>

@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.

[Previous page](https://discuss.zetetic.net/t/no-callback-after-sqlite3-key-when-using-cocoapods/1532.md?page=1)
