简体   繁体   中英

Clang Error in XCode

My app had worked well in xcode 4.4.1, but I just updated to 4.5 and am now getting a clang error. Not even sure what it is telling, has anyone experienced this before or can shed light into how I go about fixing it? here is the exact error:

Ld /Users/natehamilton/Library/Developer/Xcode/DerivedData/LCBCChurch-hacgcivdmhbavlecueatfvjbekxn/Build/Intermediates/LCBCChurch.build/Debug-iphoneos/LCBCChurch.build/Objects-normal/armv7s/LCBCChurch normal armv7s
    cd "/Users/natehamilton/Desktop/Current Projects/Work/Projects/Mobile App/LCBCChurch"
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
    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/natehamilton/Library/Developer/Xcode/DerivedData/LCBCChurch-hacgcivdmhbavlecueatfvjbekxn/Build/Products/Debug-iphoneos -F/Users/natehamilton/Library/Developer/Xcode/DerivedData/LCBCChurch-hacgcivdmhbavlecueatfvjbekxn/Build/Products/Debug-iphoneos -F/Users/Shared/Cordova/Frameworks -filelist /Users/natehamilton/Library/Developer/Xcode/DerivedData/LCBCChurch-hacgcivdmhbavlecueatfvjbekxn/Build/Intermediates/LCBCChurch.build/Debug-iphoneos/LCBCChurch.build/Objects-normal/armv7s/LCBCChurch.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=5.1 -framework Foundation -framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework AVFoundation -framework CoreLocation -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -framework CoreMedia -framework Cordova -o /Users/natehamilton/Library/Developer/Xcode/DerivedData/LCBCChurch-hacgcivdmhbavlecueatfvjbekxn/Build/Intermediates/LCBCChurch.build/Debug-iphoneos/LCBCChurch.build/Objects-normal/armv7s/LCBCChurch

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)

将“Bu​​ild Active Architecure Only”改为Yes,它会起作用:)干杯!

The armv7s architecture is the new processor type used in the iPhone 5. It looks like your Cordova framework hasn't yet been updated to support that new processor, so when clang goes to link Cordova into your application for iPhone 5 binaries, it can't do so successfully. You'll need to get an update for Cordova.

I got it working by adding references to the various architectures under the "Valid Architectures" field of the "Build Settings" for both my project and the referenced CordovaLib project. Screenshot attached. (I'm using Xcode to accomplish this instead of editing the pbxproj file in a text editor as suggested by someone in the Jira case).

The only caveat is that this method requires Cordova 2.0+, because that's the first version that references the Cordova project and source. You need to build Cordova with these settings. If you are using a previous version and don't want to upgrade, you'll have to obtain the source and build it yourself with this change to the architecture build settings.

More information: https://issues.apache.org/jira/browse/CB-1360

截图

我还没有解决任何问题,但是一些开发人员在这个网址上取得了成功

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM