Trouble building CouchbaseLiteListener.framework

64 views
Skip to first unread message

Nick Wood

unread,
Nov 5, 2014, 7:39:39 PM11/5/14
to mobile-c...@googlegroups.com
Greetings,

I'm trying to solve the same issue from this thread - https://groups.google.com/forum/#!searchin/mobile-couchbase/cors/mobile-couchbase/a80GfiBwkuI/Io-nzwOylE4J - only for iOS and having trouble building CouchbaseLiteListener.Framework for Couchbase-Lite-PhoneGap-Plugin.

I've successfully cloned couchbase-lite-ios and added the following changes (stab in the dark on whether or not these will actually fix the CORS issue):

/* Allow OPTIONS method */
if ([method isEqualToString: @"OPTIONS"])
    return kCBLStatusOK;

/* Add response headers */
[_response.headers setValue:@"*" forKey:@"Access-Control-Allow-Origin"];
[_response.headers setValue:@"GET, PUT, POST, DELETE" forKey:@"Access-Control-Allow-Methods"];
[_response.headers setValue:@"content-type, accept" forKey:@"Access-Control-Allow-Headers"];

The "CBL Listener iOS" target archives successfully, but when I drop the CouchbaseLiteListener.framework into Couchbase-Lite-PhoneGap-Plugin, then when I try to add the plugin it complains that it can't find CouchbaseLiteListener.a.

I can see the CouchbaseLiteListener file (without the ".a").  If I just rename it and add the .a, I can add the plugin to the cordova project, but then when I build, I get things like:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CBLQueryOptions", referenced from:
      objc-class-ref in CouchbaseLiteListener.a(libCouchbaseLiteListener.a-i386-master.o)
  "_OBJC_CLASS_$_CBL_GCDAsyncSocket", referenced from:
      objc-class-ref in CouchbaseLiteListener.a(libCouchbaseLiteListener.a-i386-master.o)

Any tips on what I might be doing wrong?

  Nick

Jens Alfke

unread,
Nov 10, 2014, 1:00:11 PM11/10/14
to mobile-c...@googlegroups.com, J Chris Anderson

On Nov 5, 2014, at 4:39 PM, Nick Wood <nwoo...@gmail.com> wrote:

The "CBL Listener iOS" target archives successfully, but when I drop the CouchbaseLiteListener.framework into Couchbase-Lite-PhoneGap-Plugin, then when I try to add the plugin it complains that it can't find CouchbaseLiteListener.a.

IIRC the plugin has a weird build process due to the way that the Cordova servers build the plugins that they host. JChris has complained about it in the past. He'd probably be the best one to help you.

I'll cc: him on this, but he's taking a vacation day today so he probably won't reply before tomorrow…

—Jens

Nick Wood

unread,
Nov 11, 2014, 10:24:34 AM11/11/14
to mobile-c...@googlegroups.com, jch...@couchbase.com
Thank you Jens.  I'll wait to hear from JChris.

Nick Wood

unread,
Nov 17, 2014, 1:09:01 PM11/17/14
to mobile-c...@googlegroups.com, jch...@couchbase.com
By chance, is the plugin build process documented somewhere - even if unpolished?  Anything that could get me moving forward again on this project would be very helpful.

Nick

J. Chris Anderson

unread,
Dec 4, 2014, 5:13:08 PM12/4/14
to mobile-c...@googlegroups.com, jch...@couchbase.com
Sorry about the delay.

This is the repo that builds the phonegap plguin: https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin-builder

It uses the build artifacts for iOS and Android releases as it's input, you should be able to get those from our jenkins server or our downloads page.

I'm curious what you are using CORS for?

Chris

Nick Wood

unread,
Dec 4, 2014, 5:20:09 PM12/4/14
to mobile-couchbase, Chris Anderson
No worries, thank you Chris.  I'll give this a try and post back here if I have issues.

Trying to get CORS working to solve an issue similar to the one describe in this thread - https://groups.google.com/forum/#!searchin/mobile-couchbase/cors/mobile-couchbase/a80GfiBwkuI/Io-nzwOylE4J

Basically doing PhoneGap/Cordova development and when using "livereload" functionality, it spins up a separate web server for the application files, which causes the REST calls to CBL to fail.

  Nick


--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/HmMNSNFZVj0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/411cbf18-6e9d-477b-ad96-ff680773532c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

J. Chris Anderson

unread,
Dec 5, 2014, 10:40:23 AM12/5/14
to mobile-c...@googlegroups.com, jch...@couchbase.com


On Thursday, December 4, 2014 2:20:09 PM UTC-8, Nick Wood wrote:
No worries, thank you Chris.  I'll give this a try and post back here if I have issues.

Trying to get CORS working to solve an issue similar to the one describe in this thread - https://groups.google.com/forum/#!searchin/mobile-couchbase/cors/mobile-couchbase/a80GfiBwkuI/Io-nzwOylE4J

Basically doing PhoneGap/Cordova development and when using "livereload" functionality, it spins up a separate web server for the application files, which causes the REST calls to CBL to fail.


In the past when I've wanted to do this, I've just changed my app HTML to point to http://my-machine.local/bundle.js -- I can't live reload HTML or CSS assets, but when I'm working on code it works just fine. So the HTML is coming from the device, just the JS is on my laptop.

I bet you could adapt this for CSS and templates also. In my case I was using browserify.

 Chris

  Nick


On Thu, Dec 4, 2014 at 3:13 PM, J. Chris Anderson <jch...@couchbase.com> wrote:
Sorry about the delay.

This is the repo that builds the phonegap plguin: https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin-builder

It uses the build artifacts for iOS and Android releases as it's input, you should be able to get those from our jenkins server or our downloads page.

I'm curious what you are using CORS for?

Chris

On Monday, November 17, 2014 10:09:01 AM UTC-8, Nick Wood wrote:
By chance, is the plugin build process documented somewhere - even if unpolished?  Anything that could get me moving forward again on this project would be very helpful.

Nick

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/HmMNSNFZVj0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages