我想让我的图书馆在CocoaPod中工作,但是有一个困扰我的奇怪问题。我希望有人可以指出我的错误。
我之前已经制作了一个源Pod,并成功地将其推入了主干。现在,我将源代码打包到框架中并再次进行主干推送,pod lib lint
验证过程始终报告错误ld: symbol(s) not found for architecture x86_64
。
我的来源是.swift
,而Xcode是最新的。
这是.framework lipo -info Architectures in the fat file: armv7 x86_64 arm64
.podspec
Pod::Spec.new do |s|
s.name = 'z02sckhd_6wqgx_user'
s.version = '0.1.0'
s.summary = 'TMMall framework component'
s.description = <<-DESC
description.................
DESC
s.homepage = 'https://github.com/GoGoodGo/TMMall'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'yh' => 'xxxxxxxxx@yh.com' }
s.source = { :git => 'https://github.com/GoGoodGo/TMMall.git', :tag => s.version.to_s }
s.swift_version = '4.2'
s.ios.deployment_target = '9.0'
s.requires_arc = true
s.xcconfig = {
'VALID_ARCHS' => 'arm64 x86_64',
}
s.source_files = 'z02sckhd_6wqgx_user/Classes/z02sckhd_6wqgx_user.framework/Headers/*.{h}'
s.resource = 'z02sckhd_6wqgx_user/Classes/z02sckhd_6wqgx_user.bundle'
s.vendored_frameworks = 'z02sckhd_6wqgx_user/Classes/z02sckhd_6wqgx_user.framework'
s.dependency 'Kingfisher'
s.dependency 'Cosmos'
s.dependency 'YHTool', '~> 1.1.6'
s.dependency 'MJRefresh', '~> 3.1.12'
s.dependency 'TMUserCenter'
end
错误如下
ld: symbol(s) not found for architecture x86_64
clang: error
: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/healson/Library/Developer/Xcode/DerivedData/App-fhgpxcqigtdupkgeznhcbcpvqjcl/Build/Products/Release-iphonesimulator/App.app/App normal x86_64
(1 failure)
#<Thread:0x00007f9a07212778@/Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:166 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
3: from /Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:169:in `block in reader'
2: from /Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:169:in `loop'
1: from /Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:170:in `block (2 levels) in reader'
/Users/healson/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:170:in `readpartial': stream closed in another thread (IOError)
我可以找到以下错误:
ld: warning:
Could not find auto-linked library 'swiftCoreLocation'
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SwiftObject", referenced from:
type metadata for z02sckhd_6wqgx_user.CommentData in z02sckhd_6wqgx_user(GoodsModel.o)
type metadata for z02sckhd_6wqgx_user.Comment in z02sckhd_6wqgx_user(GoodsModel.o)
type metadata for z02sckhd_6wqgx_user.CommentImage in z02sckhd_6wqgx_user(GoodsModel.o)
type metadata for z02sckhd_6wqgx_user.ShopData in z02sckhd_6wqgx_user(GoodsModel.o)
type metadata for z02sckhd_6wqgx_user.Seller in z02sckhd_6wqgx_user(GoodsModel.o)
type metadata for z02sckhd_6wqgx_user.AuctionData in z02sckhd_6wqgx_user(GoodsModel.o)
type metadata for z02sckhd_6wqgx_user.Order in z02sckhd_6wqgx_user(GoodsModel.o)
...
和
z02sckhd_6wqgx_user (0.1.0)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'Pods-App')
- NOTE | [iOS] xcodebuild: warning: Mapping architecture arm64 to x86_64.