My team recently started to employ CocoaPods to manage dependency in our iOS app project.
Here's the podfile:
platform :ios, '6.0'
pod "UI7Kit"
pod "AFNetworking", "~> 2.0"
pod "TMCache"
pod "SVProgressHUD"
pod "SVPullToRefresh"
However, after using CocoaPods, building targets for iPhone 5 always fails, but succeeds for simulator.
Here's the error log:
ld: warning: ignoring file [DerivedData directory]/libPods.a, file was built for archive which is not the architecture being linked (armv7): [DerivedData directory]/libPods.a
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in ....o
"_OBJC_CLASS_$_TMCache", referenced from:
objc-class-ref in ....o
"_OBJC_CLASS_$_UI7Kit", referenced from:
objc-class-ref in ....o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried solutions mentioned in CocoaPods Troubleshooting, including adding the Pods
static library on top of the list, but it still fails.
Later we found that in "Pods Project Settings" > "Build Settings" > "Architectures", "Base SDK" is set as "No SDK (Latest OS X)", "Build Active Architecture Only" > "Debug" set as "Yes" and "Supported Platforms" set as "OS X". After changing them to "Latest iOS (iOS 7.0)", "No", "iOS" respectively, building for iPhone 5 and simulator both work fine.
However, each time we do Pod update
, all of the three settings are reverted to their previous states, which is annoying.
My questions are:
- Is this case by design or something is wrong with my project/workspace setting?
- How to prevent these settings from being reverted to the wrong states?
Any help will be appreciated.