Dujard
Dujard

Reputation: 309

linker command failed with exit code 1 (use -v to see invocation) (armv7) xcode

I tried to compile my xcode project (i use xcode 4.5) and i have installed cordova 1,5 and the plugin BarecodeScanner on my project.

When i try to compile on iOs 6 ipod devices, i have the following error :

Ld "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4" normal armv7s
    cd /Users/username/Sites/iOS/codebarre4
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk "-L/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Products/Ad Hoc Distribution-iphoneos" "-F/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Products/Ad Hoc Distribution-iphoneos" -F/Users/Shared/Cordova/Frameworks -filelist "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4.LinkFileList" -dead_strip -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak_library /usr/lib/libSystem.B.dylib -fobjc-link-runtime -miphoneos-version-min=6.0 -weak-liconv -weak_framework CoreVideo -weak_framework AssetsLibrary -weak_framework AVFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework CoreLocation -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -framework CoreMedia -framework Cordova -o "/Users/username/Library/Developer/Xcode/DerivedData/codebarre4-dfyfuljrumiqgvbcbcsmwxzxbnuq/Build/Intermediates/codebarre4.build/Ad Hoc Distribution-iphoneos/codebarre4.build/Objects-normal/armv7s/codebarre4"

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/Shared/Cordova/Frameworks/Cordova.framework/Cordova for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This error message is very complicated to understand... i searched on the web but found anything... Have you got any idea of the origin of this message ?

Thanks a lot,

Upvotes: 2

Views: 6761

Answers (5)

Daniel Tome
Daniel Tome

Reputation: 228

What worked for me, was to set "Enable Bitcode" to "No" in the Build Settings > Build options.

Use the search on the top: http://screencast.com/t/xSCnqHGkhh

The error I was getting was:

XXX does not contain 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. for architecture arm64

Upvotes: 1

Jay Imerman
Jay Imerman

Reputation: 4600

Also see this Question.

  1. Make sure your Build Settings "Architectures" setting includes the target architecture (the processor chip) - armv7 for iOS 6, armv7s for iOS 7, etc.
  2. If you have any third party libraries you link in, make sure they are built with the proper architecture support. Otherwise rebuild those libraries or check the developer for update downloads.
  3. Finally, reopen the project with updated libraries, Clean, and Build.
  4. You may also want to verify you have an up-to-date XCode with the right iOS supporting environments.

Upvotes: 0

A_Thorne
A_Thorne

Reputation: 141

You might not have included any framework in your project. Go to

Project > targets > build phases > link binary with libraries

and add your missing framework.

Upvotes: 0

jetfire
jetfire

Reputation: 11

I was getting the same error as well.

I resolved the issue on my end by using the following steps:

  1. Going to the Build Settings for the Project.
  2. Under the Settings > Valid Architecture settings, I had the values for Debug set to armv7 and armv7s. And I had the values for Release set to armv7 and armv7s.
  3. I realized that the armv7s items were causing the problem. So I removed armv7s from both entries.

After that, I was able to archive my project with no issues.

Upvotes: 0

Sanjin Haracic
Sanjin Haracic

Reputation: 73

Your project may be configured to target armv7 which is hindering the linker.

  1. Select your project
  2. Go to info tab
  3. Remove Required Device Capability item if existing (may be armv7 called)

Upvotes: 0

Related Questions