Ios 更新swift版本和pods后出现链接器错误
我正在安装带有POD的Alamofire,并出现编译时错误。关于这一点有很多问题,但: 删除派生数据和更新播客对我不起作用 这就是错误: Alamofire/Alamofire.framework/Alamofire使用比以前的架构x86_64文件(2.0)更新版本的Swift语言(3.0)编译 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用)Ios 更新swift版本和pods后出现链接器错误,ios,swift3,alamofire,xcode8.1,Ios,Swift3,Alamofire,Xcode8.1,我正在安装带有POD的Alamofire,并出现编译时错误。关于这一点有很多问题,但: 删除派生数据和更新播客对我不起作用 这就是错误: Alamofire/Alamofire.framework/Alamofire使用比以前的架构x86_64文件(2.0)更新版本的Swift语言(3.0)编译 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用) 将其添加到pod文件的末尾,然后运行pod install: post_install do |installer| instal
将其添加到pod文件的末尾,然后运行
pod install
:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
首先删除播客,然后清理派生数据,然后-您可以在.podfile上替换此文件。
platform :ios, '9.3'
source 'https://github.com/CocoaPods/Specs.git'
target 'Meanwise' do
use_frameworks!
pod 'pop', '~> 1.0'
pod 'Alamofire', '~> 4.0'
end
更新pod文件中的以下内容:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3' || '3.0'
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
end
end
end
要修复特定的swift pod版本,请执行以下操作: 代码段:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == '<insert target name of your pod here>'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
end
post|u install do|installer|
installer.pods_project.targets.each do| target|
如果target.name=“”
target.build|u configurations.each do| config|
config.build_设置['SWIFT_VERSION']='3.2'
结束
结束
结束
结束
它仍然是一样的。请手动将此项添加到项目设置中。。。。ALWAYS\u EMBED\u SWIFT\u STANDARD\u Libraries您的项目是否已完全转换为SWIFT 3和Xcode 8?让我检查一下。请在您的mac电脑中至少安装新的pod版本1.1.0,并检查Xcode project build setting>legacy=NOI内部,我认为这可能是原因。让我检查一下。当然要尝试一下,因为有时会发生这种情况,在迁移代码时也会遇到这种类型的问题。