Hi,
I’m trying to use CouchbaseLite inside a Swift custom Framework (under iOS8) but I have no visibility on CB classes.
I imported CouchbaseLite framework file inside my framework and added needed dependencies and settings.
Being a custom framework I can’t use a bridging header neither can add a #import to the umbrella header or my own Swift classes.
Is there a way to be able to use CB this way? (CouchbaseLite framework file inside a custom Framework)
Why not? As far as I know, bridging headers are not specific to app targets.
Note that since Couchbase Lite is a static library (not a true dynamic framework) you don’t use import to access it. The classes will be in your namespace as though they were your own source files.
jens, bridging headers cannot be used inside Framework targets. So, we have no visibility from our framework to the CB Framework classes.
If you need a sample project (framework type project) I can send it to you so you can see exactly what’s the issue.
Sorry for the late reply. Can you upload the sample project with the CouchbaseKit custom framework?
There’s an upload button in this forum you can use to attach it to your message for everyone to see.
Hi there, I cannot upload the file as the forum says "new users can’t upload files."
However, here you have a link to it so you can test it. As you will see, I’m unable to use the CB classes inside my class CouchbaseDB…
@itssrinadh Yes! It would be great if you could share a sample project with that setup. I had tried to do it with a modulemap file as suggested in the gitter channel:
Yes but more specifically the question is about how to import Couchbase Lite in a Framework (called CouchbaseUtils for example) and then that framework could be reused across different Xcode projects.
Hi there. Any updates on this subject ? We are trying to include CouchbaseLite framework in a swift based CocoaTouch framework and running in this “include of non-modular header inside …” error.
Is the solution using a module.modulemap file working ?
Hi,
Can you please provide more information on how did you accomplish that as I have already done so as I have answered How I have done.
What worked that Xcode will run and build successfully , but when I tried to run
Pod lint to complete the pod framework of it it will give errors on
- ERROR | [iOS] unknown: Encountered an unknown error (The 'Pods-App' target has transitive dependencies that include static binaries: (/private/var/folders/wr/lx9z4zts15nbqb9wxwsp2ryh0000gn/T/CocoaPods/Lint/Pods/couchbase-lite-ios/CouchbaseLite.framework and /private/var/folders/wr/lx9z4zts15nbqb9wxwsp2ryh0000gn/T/CocoaPods/Lint/Pods/couchbase-lite-ios/CouchbaseLiteListener.framework)