【发布时间】:2018-12-05 02:06:59
【问题描述】:
报告
你做了什么?
我已经为我的自定义框架创建了 podspec 文件:
Pod::Spec.new do |s|
s.platform = :ios
s.ios.deployment_target = '10.0'
s.name = "CustomFramework"
s.summary = "CustomFramework have all the wrapper API."
s.requires_arc = true
s.version = "1.0.0"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "My Name" => "my.name@xyz.com" }
s.homepage = "URL_LINK"
s.source = { :git => "github_url_link", :tag => "#{s.version}"}
s.dependency 'RealmSwift', '3.5.0'
s.dependency 'Firebase/Core', '5.1.0'
s.dependency 'Firebase/Firestore', '5.1.0'
s.dependency 'PubNub','4.7.5'
s.source_files = "CustomFramework/**/*.{swift}"
end
我在示例项目中将此自定义框架 pod 添加为:
target 'customFrameworkSample' do
use_frameworks!
pod 'customFramework' , :path => 'Local_Path_for_customFramework.podspec'
target 'customFrameworkSampleTests' do
use_frameworks!
pod 'customFramework' , :path => 'Local_Path_for_customFramework.podspec'
end
end
您预计会发生什么?
Pod 应该正确安装,并且当示例项目构建时,它应该运行并且不会抛出任何错误。
发生了什么?
在示例项目中,在 CustomFramework 文件中导入 firbase、RealmSwift 文件等时会引发错误。
CocoaPods 环境
可可足:1.5.3
【问题讨论】:
-
Xcode 解析器在第一次构建之后才看到模块。
标签: ios swift frameworks dependencies cocoapods