New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode 12 Clang: Error in PodSpec Validation due to architectures #10104
Comments
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,
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:
Here is a great stackoverflow post on how to solve the issue. 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 |
hey, Choose the right section to resolve it on your side.
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
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 |
See the problem description in CocoaPods/CocoaPods#10104 (comment) The long-term fix is to include support for the arm64 simulator in the framework, ideally by creating an xcframework instead of making the fat binary larger.
* Split out the subspecs into a set of individual podspec files * Workaround Xcode 12 issue requiring Apple silicon arch See the problem description in CocoaPods/CocoaPods#10104 (comment) The long-term fix is to include support for the arm64 simulator in the framework, ideally by creating an xcframework instead of making the fat binary larger. Co-authored-by: Brandon Siegel <brsiegel@microsoft.com>
Thanks @tinchovictory @hibrq |
Suggested solution is obtained from CocoaPods/CocoaPods#10104 (comment)
Suggested solution is obtained from CocoaPods/CocoaPods#10104 (comment) This issue has been found since Flutter 2.5.0.
Suggested solution is obtained from CocoaPods/CocoaPods#10104 (comment)
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
The text was updated successfully, but these errors were encountered: