我正在创建我的自定义框架与依赖(Alamofire,SVGKit,lottie等)
我的问题是,当我创建它并在本地导入它工作正常,但当我通过pod导入它不工作。
[![1]][1]
当我像上面的图片一样导入它时,它可以工作
然后我创建了像下面这样的podspec文件,通过了验证,然后我把框架和podspec文件推到github上。
Pod::Spec.new do |s|
s.name = "testSDK"
s.version = "1.0.0"
s.summary = "test"
s.description = <<-DESC
test
DESC
s.homepage = "https://github.com/test/test"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "john" => "test@test.com" }
s.ios.deployment_target = '12.0'
s.ios.vendored_frameworks = 'testSDK.framework'
s.source = { :git =>
'https://github.com/test/test.git',
:tag => s.version.to_s
}
s.swift_version = '5.0'
s.exclude_files = "Classes/Exclude"
s.dependency 'Alamofire', '~> 5.4.1'
s.dependency 'IQKeyboardManagerSwift', '~> 6.5.6'
s.dependency 'lottie-ios', '~> 3.2.1'
s.dependency 'SVGKit', '~> 3.0.0'
s.dependency 'CocoaLumberjack/Core', '~> 3.7.2'
s.pod_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
}
s.user_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
}
end
然后我安装了pod它给出了这个错误
yld[45478]: Symbol not found:
$s9Alamofire21URLRequestConvertibleP02asB010Foundation0B0VyKFTq
Referenced from:
/Users/john/Library/Developer/CoreSimulator/Devices/5A694E99-89DA-418E-8BAC-
19BA00DDDD40/data/Containers/Bundle/Application/FB5D28A0-9089-4428-B32F-
AA2CCF6EC7CE/ios-sdk-example.app/Frameworks/testSDK.framework/testSDK
Expected in: /Users/john/Library/Developer/CoreSimulator/Devices/5A694E99-
89DA-418E-8BAC-19BA00DDDD40/data/Containers/Bundle/Application/FB5D28A0-9089-4428-
B32F-AA2CCF6EC7CE/ios-sdk-example.app/Frameworks/Alamofire.framework/Alamofire
Symbol not found: $s9Alamofire21URLRequestConvertibleP02asB010Foundation0B0VyKFTq
Referenced from:
/Users/john/Library/Developer/CoreSimulator/Devices/5A694E99-89DA-418E-8BAC-
19BA00DDDD40/data/Containers/Bundle/Application/FB5D28A0-9089-4428-B32F-
AA2CCF6EC7CE/ios-sdk-example.app/Frameworks/testSDK.framework/testSDK
Expected in: /Users/john/Library/Developer/CoreSimulator/Devices/5A694E99-
89DA-418E-8BAC-19BA00DDDD40/data/Containers/Bundle/Application/FB5D28A0-9089-4428-
B32F-AA2CCF6EC7CE/ios-sdk-example.app/Frameworks/Alamofire.framework/Alamofire
当导入我的自定义框架在本地工作。但从github它不工作[1]: https://i.stack.imgur.com/F0OjZ.png
我在测试中添加了以下代码。Podspec文件和上传在我的github地址与podfile和podfile。锁工作。
s.public_header_files = "test.framework/Headers/*.h"
s.source_files = "test.framework/Headers/*.h"