Open dshackelford opened 3 years ago
This is probably the same or similar issue around VALID_ARCHS being deprecated in Xcode 12 and EXCLUDED_ARCHS needed.
Thanks for the report.
Xcode 12 includes simulators supporting arm64 architecture (for the new apple silicon mac), so many framework need to be compiled again to include the arm64 slice for the simulator. Meanwhile, you should exclude the arm64 architecture of the simulator while compiling, otherwise it's gonna fail because it can't find the arm64 slice.
Unfortunately, pod lib lint
fails if your pod dependes on another without the arm64 support for the simulator. Adding any configuration to the Podfile
won't fix it since pod lib lint
internally creates a new workspace only based on the .podspec
. In my case I was able to succesfully run pod lib lint
by adding:
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
if the development pod has a direct dependency with the pod missing the arm64 slice. But on pods failing because of a transitive dependency I only need to add:
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
Here is a great stackoverflow post on how to solve the issue. The same issue was also reported in #9967
After trying many days, I couldn't find any better solution.
@tinchovictory makes sense. I assume your pod is a pre-built binary pod? Or does this fail with pods that have sources?
The podspec specified here btw is a private pod. I will need an easy to repro case with a source pod or a pre-built binary pod.
@dnkoutso yes I have the issue with Google Analytics which is a pre-build pod. But I also have the same problem with Realm. They have an open issue related to this.
Yes, this is a private podspec.
I am unable to create a "reproducible" case for you at this time. But using @tinchovictory 's recommendation of adding excluded architectures in the podspec fixed the problem for now, and I am able to push my private podspec without any clang errors.
I have let the creators of the dependent pod know of the issue and await their response/update.
Thanks!
A static framework build from mars (https://github.com/Tencent/mars) only supports ARM64 and x86_64 When validation is performed, an error is reported, The following build commands (pod lib lint) failed: Ld /Users/... /Objects-normal/i386/Binary/HILog normal i386 I need to add configuration in xxx.podspec : s.pod_target_xcconfig = { 'VALID_ARCHS' => 'armv7 arm64 x86_64'} and it's work. This error occurred because mars did not contain i386 (32-bit) architecture(I think), so I removed i386 from VALID_ARCHS. However, Mars only supports ARM64 and X86_64 architectures, and I added ARMV7 to VALID_ARCHS to get this right. That might be a little unreasonable .
hey,
Choose the right section to resolve it on your side.
For SDK owners:
The solution is to open the podspec and add below:
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'}
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'}
s.ios.deployment_target = '10.0' // not required
For SDK users:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
@ElizaSapir SDK owners should only add those lines to the podspec
if they depend on another SDK which is missing the arm64 slice for simulators. But this is a temporary fix. Hopefully, the SDK's dependencies add the arm64 slice for simulators in the near future. When that happens, we need to remove those lines, otherwise we will be breaking compatibility for new macs.
Thanks @tinchovictory @hibrq
Report
Hello, I recently updated to Xcode 12 and I am having errors with pushing my private podspec to my repo. It has to do with a dependency that I don't have control over, that I believe has an error with their valid Architecture definitions.
I have read other posts/issues on this git hub page about how to write Post_installs for installing a pod via a podfile, but I am trying to validate a podspec in which has a
spec.dependency
that is the issue. I am able to install the pod directly via podfile after adjusting the self-defined VALID_ARCHS setting in the build settings to include x86_64. Is there a similar Post_Install command I can add to my PodSpec?I'm not sure you can help me since I'm not even sure what the problem is exactly, but I was hoping maybe I could get some information. Let me know if you need any more information. Thanks.
What did you do?
Run
pod repo push MyPodSpecs DroneKit.podspec
What did you expect to happen?
I expected
DroneKit
to be added toMyPodSpecs
successfully.What happened instead?
I got an error while validating spec:
ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use
--verbosefor more information.
So I ran with
--verbose
, and found mention of a clang error:ld: building for iOS Simulator, but linking in dylib built for iOS, file '/var/folders/pn/4cgjvr1j7mzbnl55pfnzlgr00000gq/T/CocoaPods-Lint-20200929-48311-11st24n-DroneKit/Pods/DJI-SDK-iOS/iOS_Mobile_SDK/DJISDK.framework/DJISDK' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
The following build commands failed: Ld /Users/dylan/Library/Developer/Xcode/DerivedData/App-ckgszeaogfkgqlddwiywgfcjzsrb/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/DroneKit.build/Objects-normal/arm64/Binary/DroneKit normal arm64 (1 failure)
CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
PodSpec