Xcode 4.5 Linker Error

222 views
Skip to first unread message

mike

unread,
Sep 20, 2012, 9:56:30 AM9/20/12
to mobile-c...@googlegroups.com
Downloaded the official Xcode 4.5 this morning and ran into a linker problem when trying to build my app and the TouchDB-iOS iOS Demo app for an iOS 6 device.  Here's the error:

ld: file is universal (2 slices) but does not contain a(n) armv7s slice: /Users/mike.lamb/Developer/G3CouchDB/Frameworks/CouchCocoa.framework/CouchCocoa for architecture armv7s

I found adding armv7s to the Architecture build setting for the the iOS Library in CouchCocoa fixed the problem.

Xcode 4.5.png

Maher Ali

unread,
Sep 20, 2012, 12:31:42 PM9/20/12
to mobile-c...@googlegroups.com
I removed it from the valid architectures field.
I'm not sure if this better or worse. That's what people on the internets say you should do.
You should see this problem with other third-party libs.

Regards,

Maher

mike

unread,
Sep 20, 2012, 12:55:53 PM9/20/12
to mobile-c...@googlegroups.com
Good to know.

In many cases, just rebuilding the third party library will solve the problem if that library uses the default value for Architectures.  For example, TouchDB-iOS uses the default value so no problems there.  CouchCocoa doesn't use the default value because it provides support for i386.

Traun Leyden

unread,
Sep 20, 2012, 1:06:24 PM9/20/12
to mobile-c...@googlegroups.com

My CouchCocoa is already set to architectures arm7 and arm7s, but when I build with xcode 4.5 and try to deploy to an iphone 4s running ios 5.0.1, I get that same error:

ld: file is universal (2 slices) but does not contain a(n) armv7s slice: /Users/tleyden/Documents/work/signature-ios/Associate/CouchCocoa.framework/CouchCocoa for architecture armv7s

clang: error: linker command failed with exit code 1 (use -v to see invocation)

OTOH it works fine when deploying to the ios 6.0 simulator.. or even the ios 5.0 simulator.

Jens Alfke

unread,
Sep 20, 2012, 1:55:11 PM9/20/12
to mobile-c...@googlegroups.com

On Sep 20, 2012, at 9:55 AM, mike <lam...@gmail.com> wrote:

In many cases, just rebuilding the third party library will solve the problem if that library uses the default value for Architectures.  For example, TouchDB-iOS uses the default value so no problems there.  CouchCocoa doesn't use the default value because it provides support for i386.

I can’t think of a reason CouchCocoa should need a custom Architectures setting, if TouchDB doesn’t. They’re very similar in the way they build. You could try resetting this to default in CouchCocoa and see if that helps.

—Jens

mike

unread,
Sep 20, 2012, 3:07:14 PM9/20/12
to mobile-c...@googlegroups.com
That works great.  Thanks for the suggestion!

Traun Leyden

unread,
Sep 20, 2012, 4:22:33 PM9/20/12
to mobile-c...@googlegroups.com

I got the same error when trying to build to an io6 device.

As a workaround I set "Build Active Architecture Only" to YES in both the CouchCocoa and my app projects... and now it works.  But it seems like a bad idea to have that flag set to YES.  

Jens Alfke

unread,
Sep 20, 2012, 4:43:38 PM9/20/12
to mobile-c...@googlegroups.com
I’ve fixed the build setting in CouchCocoa and pushed the change. iOS apps build successfully now for me in Xcode 4.5.

—Jens

Traun Leyden

unread,
Sep 20, 2012, 5:46:34 PM9/20/12
to mobile-c...@googlegroups.com

This fixed my issue!  Thanks.

--
 
 

Andrew Gold

unread,
Oct 6, 2012, 5:48:44 PM10/6/12
to mobile-c...@googlegroups.com
Hi Jens

Any chance you can fix the build setting in CouchCocoa for the non TouchDB version to build under Xcode 4.5? And make it available for download. I can't find a version I can amend and build myself.

My client wants to support pre iOS 5, so I'm unable to use TouchDB for the app i'm working on.

Thanks

Andy

Jens Alfke

unread,
Oct 6, 2012, 6:26:38 PM10/6/12
to mobile-c...@googlegroups.com

On Oct 6, 2012, at 2:48 PM, Andrew Gold <andyg...@gmail.com> wrote:

Any chance you can fix the build setting in CouchCocoa for the non TouchDB version to build under Xcode 4.5? And make it available for download. I can't find a version I can amend and build myself.

The regular version is supposed to work without TouchDB — it’s careful to look up TouchDB symbols at runtime instead of hard-linking to them. If that’s true, let me know what errors you get (file a bug report, preferably.)

—Jens

Andrew Gold

unread,
Oct 6, 2012, 6:33:25 PM10/6/12
to mobile-c...@googlegroups.com
Hi Jens

Thanks for your quick reply.

When I add the latest CouchCocoa.framework, it won't compile my app anymore and tells me CouchEmbeddedServer is not found. The only option then is to replace those lines with the TouchDB server and compile it once more. Once I do that is says that TouchDB is not setup.

Thanks

Andy

Andrew Gold

unread,
Oct 15, 2012, 12:54:20 PM10/15/12
to mobile-c...@googlegroups.com
Hi Jens

I've got to the stage now, where without that setting i'm unable to create an IPA under Xcode 4.5, and without creating it under 4.5 my app is not syncing with the couchdb database on any iOS 6 device when I create the IPA under an earlier version of Xcode. Connecting it to Xcode 4.5 and building directly to the iOS 6 device does work and pre iOS 6 devices work fine with my IPA.

I'm left to think now, that it's due to not having the arm7s setting in the CouchCocoa source and as I don't have source for the pre TouchDB version of CouchCocoa i'm unable to make the change myself and unable to find it on the Internet.

If you could possibly email me the source of an earlier version, then I can make the change and build it. This will then hopefully enable me to build an IPA in Xcode 4.5 for iOS 6 devices. As without this I can't get people to test the app and won't be able to submit it to Apple.

Having it run on pre iOS devices is a requirement at this time, so using TouchDB is out unless it is the last resort.

If i'm barking up the wrong tree with this problem, let me know.

Regards

Andy

On Sunday, October 7, 2012 12:26:41 AM UTC+2, Jens Alfke wrote:

Jens Alfke

unread,
Oct 15, 2012, 1:02:28 PM10/15/12
to mobile-c...@googlegroups.com
On Oct 15, 2012, at 9:54 AM, Andrew Gold <andyg...@gmail.com> wrote:

I'm left to think now, that it's due to not having the arm7s setting in the CouchCocoa source and as I don't have source for the pre TouchDB version of CouchCocoa i'm unable to make the change myself and unable to find it on the Internet.

As I said before, there isn’t some separate version of CouchCocoa for use without TouchDB. CouchCocoa should not be dependent on TouchDB, so you should be able to build your app with the current version. If it doesn’t build, please file a bug and I’ll fix it ASAP.

If you could possibly email me the source of an earlier version

It’s a git repository. You have the entire project history available to you, all the way back to May 2011. That said, there have been a lot of fixes since I added the TouchDB support, so I wouldn’t recommend dumpster-diving for old code :)

—Jens
Reply all
Reply to author
Forward
0 new messages