I'm using the CocoaAsyncSocket
library for an application I am writing.
When I compile and run it on my own device there's no problem and Xcode is able to find CocoaAsyncSocket
.
However when I'm trying to Archive it won't compile and I get the error message that the module CocoaAsyncSocket
can't be found.
I've noticed that it has something to do with the different architectures. When I build for my own device its only building for "arm64" and when I'm archiving its building for arm64
,armv7
and armv7s
. If I change the build settings for archiving to only build for arm64
I'm able to archive. But of course I want to be able to build it for all architectures.
Picture below displays settings for when its only building for arm64
(in my case);
Build Active Architecture Only: Yes
Has anyone else experienced similar problems with this library or other Cocoapod libraries?
Many developers have embraced the impending 64-bit future but not all third party libraries support this architecture yet, including those installable via CocoaPods
.
Despite the lack of universal 64-bit support among 3rd-party pods, CocoaPods still includes the arm64 architecture (via ARCHS_STANDARD_INCLUDING_64_BIT
) in its generated targets’ build settings. This can cause problems if your app’s dependencies don’t support arm64, or you only want to build for armv7 and armv7s for other reasons.
You can fix this just add the following to the bottom of your Podfile
to revert the ARCHS
build setting to ARCHS_STANDARD
:
# Remove 64-bit build architecture from Pods targets
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD_32_BIT)'
end
end
end
Note :
CocoaPods Troubleshooting Guide recommends matching the Debug setting in your Xcode project, rather than changing the Pod's Build Active Architecture Only. As long as they match it seems to fix the problem.
Or
You can try updating cocoapods
in your terminal using command:
gem update cocoapods
If it doesn't work after that, go into your workspace, click on the Pod project, select all Pod targets and set Architectures to (armv7 armv7s arm64
).