使用M1电脑的pod package打包framework会出现各种各样问题,将踩到的坑记录如下:
pod 打包framework
先安装sudo gem install cocoapods–packager
xcode–select: error: tool ‘xcodebuild’ requires Xcode, but active
developer directory ‘/Library/Developer/CommandLineTools’ is a command
line tools instance
如果本次确实已安装LineTool需要关联路径。
执行下面命令
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
pod package 你的项目.podspec --force —embedded --no-mangle --exclude-deps
/var/folders/j5/wglq81t90xs_vcwywb93c7pr0000gn/T/cocoapods-7w8f4l0n/Pods/Pods.xcodeproj:
warning: The iOS deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set
to 9.0, but the range of supported deployment target versions is 11.0
to 16.2.99. (in target ‘Pods–packager’ from project ‘Pods’)
error: The armv7 architecture is deprecated. You should update your ARCHS build setting to remove the armv7 architecture. (in target
‘Pods–packager’ from project ‘Pods’)
error: The armv7s architecture is deprecated. You should update your ARCHS build setting to remove the armv7s architecture. (in target
‘Pods-packager’ from project ‘Pods’)
/var/folders/j5/wglq81t90xs_vcwywb93c7pr0000gn/T/cocoapods-7w8f4l0n/Pods/Pods.xcodeproj:
warning: The iOS deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set
to 9.0, but the range of supported deployment target versions is 11.0
to 16.2.99. (in target ‘JDTGateway’ from project ‘Pods’)
error: The armv7 architecture is deprecated. You should update your ARCHS build setting to remove the armv7 architecture. (in target
‘JDTGateway’ from project ‘Pods’)
error: The armv7s architecture is deprecated. You should update your ARCHS build setting to remove the armv7s architecture. (in target
‘JDTGateway’ from project ‘Pods’)
fatal error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo:
Pods/build/package.a and Pods/build–sim/package.a have the same
architectures (arm64) and can’t be in the same fat output file
Usage:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
–static [-] file […] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-dynamic [-] file […] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #]
[-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#]
[-segs_read_write_addr 0x#] [-seg_addr_table ]
[-seg_addr_table_filename <file_system_path>] [-all_load]
[-noall_load] fatal error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo:
can’t open input file: Pods/build-sim/package.a (No such file or
directory)
以上解决方案:
修改podspec文件,添加以下配置,真机、模拟器编译时候排除arm7等架构。
s.pod_target_xcconfig = {
# 'VALID_ARCHS' => 'arm64',
'EXCLUDED_ARCHS[sdk=iphoneos*]' => 'armv7 armv7s',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'armv7 armv7s arm64'
}
s.user_target_xcconfig = {
# 'VALID_ARCHS' => 'arm64',
'EXCLUDED_ARCHS[sdk=iphoneos*]' => 'armv7 armv7s',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => "armv7 armv7s arm64"
}
原文地址:https://blog.csdn.net/ilinlinying/article/details/129384123
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_14273.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!