问题
I'm getting this error, only when I try to build and run on an iPhone 5. It works fine on an iPhone 6 or greater. These are all cocoaPods generating the error. I've ran pod install, pod update, wiped out the pods and started over, nothing:
I've tried all the answers from here: Undefined symbols for architecture armv7 for Cocoapods libraries with no luck. Here is the verbose output from pod install
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Celeo`: (``)
Finding Podfile changes
- Braintree
- ConciseKit
- EDStarRating
- Google
- IDMPhotoBrowser
- KAProgressLabel
- MBProgressHUD
- MagicalRecord
- SFHFKeychainUtils
- TwilioConversationsClient
- TwilioSDK
Resolving dependencies of `Podfile`
Comparing resolved specification to the sandbox manifest
- Braintree
- ConciseKit
- DACircularProgress
- EDStarRating
- FirebaseAnalytics
- FirebaseInstanceID
- Google
- GoogleAnalytics
- GoogleInterchangeUtilities
- GoogleSymbolUtilities
- GoogleUtilities
- IDMPhotoBrowser
- KAProgressLabel
- MBProgressHUD
- MagicalRecord
- SDWebImage
- SFHFKeychainUtils
- TwilioCommon
- TwilioConversationsClient
- TwilioSDK
- pop
Downloading dependencies
-> Using Braintree (4.3.1)
-> Using ConciseKit (0.1.2)
-> Using DACircularProgress (2.3.1)
-> Using EDStarRating (1.1)
-> Using FirebaseAnalytics (3.2.0)
-> Using FirebaseInstanceID (1.0.6)
-> Using Google (3.0.3)
-> Using GoogleAnalytics (3.14.0)
-> Using GoogleInterchangeUtilities (1.2.1)
-> Using GoogleSymbolUtilities (1.1.1)
-> Using GoogleUtilities (1.3.1)
-> Using IDMPhotoBrowser (1.8.4)
-> Using KAProgressLabel (3.2)
-> Using MBProgressHUD (0.9.2)
-> Using MagicalRecord (2.3.2)
-> Using SDWebImage (3.7.6)
-> Using SFHFKeychainUtils (0.0.1)
-> Using TwilioCommon (0.2.2)
-> Using TwilioConversationsClient (0.24.1)
-> Using TwilioSDK (1.2.10)
-> Using pop (1.0.9)
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Adding source files to Pods project
- Adding frameworks to Pods project
- Adding libraries to Pods project
- Adding resources to Pods project
- Linking headers
- Installing targets
- Installing target `Braintree` iOS 7.0
- Installing target `ConciseKit` iOS 4.3
- Installing target `DACircularProgress` iOS 5.0
- Installing target `EDStarRating` iOS 4.3
- Installing target `IDMPhotoBrowser` iOS 7.0
- Installing target `KAProgressLabel` iOS 4.3
- Installing target `MBProgressHUD` iOS 4.3
- Installing target `MagicalRecord` iOS 6.1
- Installing target `SDWebImage` iOS 5.0
- Installing target `SFHFKeychainUtils` iOS 4.3
- Installing target `pop` iOS 6.0
- Installing target `Pods-Celeo` iOS 9.0
- Running post install hooks
- Writing Xcode project file to `Pods/Pods.xcodeproj`
- Generating deterministic UUIDs
- Writing Lockfile in `Podfile.lock`
- Writing Manifest in `Pods/Manifest.lock`
Integrating client project
Integrating target `Pods-Celeo` (`Celeo.xcodeproj` project)
- Running post install hooks
- cocoapods-stats from
`/Library/Ruby/Gems/2.0.0/gems/cocoapods-stats-1.0.0/lib/cocoapods_plugin.rb`
Sending stats
- Braintree, 4.3.1
- ConciseKit, 0.1.2
- DACircularProgress, 2.3.1
- EDStarRating, 1.1
- FirebaseAnalytics, 3.2.0
- FirebaseInstanceID, 1.0.6
- Google, 3.0.3
- GoogleAnalytics, 3.14.0
- GoogleInterchangeUtilities, 1.2.1
- GoogleSymbolUtilities, 1.1.1
- GoogleUtilities, 1.3.1
- IDMPhotoBrowser, 1.8.4
- KAProgressLabel, 3.2
- MBProgressHUD, 0.9.2
- MagicalRecord, 2.3.2
- SDWebImage, 3.7.6
- SFHFKeychainUtils, 0.0.1
- TwilioSDK, 1.2.10
- pop, 1.0.9
Pod installation complete! There are 11 dependencies from the Podfile and 21
total pods installed.
回答1:
In Xcode, hold the option key and select Product / Clean Build Folder. Then rebuild. I've had this exact problem and this "deep clean" resolves it for me.
Also, ensure that for your Pods project that the build setting for Build Active Architecture Only is set to NO.
回答2:
This works great in most cases :
- Make sure your Project targets have
$(inherited)
present in theOther Linker Flags
in Build Settings. - If the above hasn't solved it already, Close Xcode.
- Open Finder, and select
Go
in Menu bar and thenGo to folder
- Paste the following -
~/Library/Developer/Xcode
- Find the (devil) folder named
DerivedData
- Delete it, that is move to trash (Optional : Clean the trash)
- Open your Workspace in Xcode now (Optional : Clean your project)
- Build your project... thank me later.
If this doesnt work, create a new question and post your logs of pod install
there. Something is going wrong in installation itself. Make sure you are using a stable latest version of Cocoapod.
回答3:
None of the answers above helped me. It turns out using frameworks for my pods instead of static libraries fixed it. Adding use_frameworks! to Podfile fixed it:
platform :ios, '9.3'
use_frameworks!
...rest of podfile
来源:https://stackoverflow.com/questions/37619389/undefined-symbols-for-architecture-armv7-cocoapods-iphone-5