Can't find iOS framework when self compiled

242 views
Skip to first unread message

Brendan Duddridge

unread,
Jun 28, 2015, 3:29:08 PM6/28/15
to mobile-c...@googlegroups.com
Hi,

When I compile the iOS Couchbase Framework and add it to my project, my project is unable to find it when I reference Couchbase like this:

#import <CouchbaseLite/CouchbaseLite.h>


I've tried all manner of variations on the above (e.g. "CouchbaseLite/CouchbaseLite.h" or just "CouchbaseLite.h" after the import. I also checked my Framework Search Path for my target and project to make sure it has an entry for the folder where the CouchbaseLite.framework bundle is.  My iOS project just won't compile when I use the version I compiled by archiving the "Continuos iOS" target from master. It simply says <CouchbaseLite/CouchbaseLite.h> is not found. The same setup works just fine on my Mac app. This seems to be limited to my iOS project.

If I add it to my project using Cocoapods then it does find it, but I get the following warnings:

ld: warning: URGENT: all bitcode will be dropped because '/Users/brendan/Projects/tapforms-ios/Pods/couchbase-lite-ios/CouchbaseLite.framework/CouchbaseLite(CBL_Revision.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.


I would rather not disable bitcode in my project.

I've tried adding CouchbaseLite.framework to a brand new Objective-C test project and it still fails to find it. I'm quite puzzled by this. I've been adding third party frameworks to my apps for years and this time I just can't seem to get it to find it.

I'm using Xcode 7.0 beta (7A120f)

Any ideas or a sample Objective-C project with the framework compiled from master would be very helpful so I can see what I'm doing wrong.

Thanks,

Brendan

Jens Alfke

unread,
Jun 28, 2015, 8:24:19 PM6/28/15
to mobile-c...@googlegroups.com
On Jun 28, 2015, at 12:29 PM, Brendan Duddridge <bren...@gmail.com> wrote:

Hi,

When I compile the iOS Couchbase Framework and add it to my project, my project is unable to find it when I reference Couchbase like this:

#import <CouchbaseLite/CouchbaseLite.h>

Hm. That is the correct syntax; you shouldn’t change it.


I also checked my Framework Search Path for my target and project to make sure it has an entry for the folder where the CouchbaseLite.framework bundle is.

It sounds like the search path is wrong.
What exactly is the “Framework Search Paths” setting for your target?
And what are the exact absolute paths to the Xcode project and to the CouchbaseLite.framework?

(Also, as a sanity check, make sure that the framework has a Headers directory that contains the expected headers.)

I would rather not disable bitcode in my project.

Then you’ll need to build your own Couchbase Lite for the time being. Only Xcode 7 has support for emitting bitcode, but we won’t ship a release built with a beta-quality compiler. Once Xcode 7 ships, our next Couchbase Lite release will be built with it and include bitcode.

—Jens

Brendan Duddridge

unread,
Jun 28, 2015, 8:46:37 PM6/28/15
to mobile-c...@googlegroups.com
Here's the absolute path to the framework:

/Users/brendan/Projects/tapforms-ios/Tap Forms/Third Party/CouchbaseLite.framework


And my Project's Framework Search Path:

$(inherited) "$(SRCROOT)/Tap Forms" "$(PROJECT_DIR)/Tap Forms/Third Party"

the Target's Framework Search Path is:

$(inherited) "$(PODS_ROOT)/Dropbox-Sync-API-SDK/dropbox-ios-sync-sdk-3.1.2" $(PODS_ROOT)/TextExpander

So it should be inheriting the "$(PROJECT_DIR)/Tap Forms/Third Party" which is where the framework is sitting in my project directory.

And when I compile, I get this error:

/Users/brendan/Projects/tapforms-ios/Tap Forms/Tap Forms-Prefix.pch:12:9: fatal error: 'CouchbaseLite/CouchbaseLite.h' file not found

#import <CouchbaseLite/CouchbaseLite.h>

        ^

1 error generated.


And within the CouchbaseLite.framework bundle, I have the following:

CouchbaseLite
Headers/
   
CBLAttachment.h
   
CBLAuthenticator.h
   
CBLBase.h
   
CBLDatabase.h
   
CBLDatabaseChange.h
   
CBLDocument.h
   
CBLGeometry.h
    CBLJSON
.h
   
CBLManager.h
   
CBLModel.h
   
CBLModelFactory.h
   
CBLQuery.h
   
CBLQuery+FullTextSearch.h
   
CBLQuery+Geo.h
   
CBLQueryBuilder.h
   
CBLRegisterJSViewCompiler.h
   
CBLReplication.h
   
CBLRevision.h
   
CBLUITableSource.h
   
CBLView.h
   
CouchbaseLite.h
   
MYDynamicObject.h
Info.plist
PrivateHeaders/
   
CBLReplication+Transformation.h
   
CBLStatus.h
   
CouchbaseLitePrivate.h


So I'm a bit perplexed. I compiled the Continuos iOS target and pulled the framework out of the xcodearchive. 

Thanks for your help.

Brendan

Jens Alfke

unread,
Jun 28, 2015, 9:37:16 PM6/28/15
to mobile-c...@googlegroups.com
Try looking at the build log in the Report Navigator and expanding the file that got the error so you can see the raw compile command and output. The compile command will have some “-F” flags followed by paths of framework search paths. Make sure it’s got the path to where the Couchbase Lite framework is.

—Jens

Brendan Duddridge

unread,
Jun 29, 2015, 1:12:15 AM6/29/15
to mobile-c...@googlegroups.com
So it turns out that I had referenced a class in my WatchKit Extension which was referencing Couchbase. So I had to add the CouchbaseLite.framework to my WatchKit Extension. But it's all good now.
Reply all
Reply to author
Forward
0 new messages