objective-c – 无法在单元测试中使用Cocoapod

objective-c – 无法在单元测试中使用Cocoapod,第1张

概述我在我正在建造的应用程序中使用一个名为temple8的内部 cocoapod.这是我的Podfile: platform :ios, '9.0'def temple8 pod 'j2objc-temple8-debug', :configuration => ['Debug'], :path => '../temple8/build/j2objcOutputs' pod 'j2 我在我正在建造的应用程序中使用一个名为temple8的内部 cocoapod.这是我的Podfile:

platform :ios,'9.0'def temple8    pod 'j2objc-temple8-deBUG',:configuration => ['DeBUG'],:path => '../temple8/build/j2objcOutputs'    pod 'j2objc-temple8-release',:configuration => ['Release'],:path => '../temple8/build/j2objcOutputs'endtarget 'cartful-ios' do  use_frameworks!  temple8  pod 'Stripe'  pod 'Alamofire','~> 4.0'  pod 'FontAwesomeKit',:git => 'https://github.com/PrIDeChung/FontAwesomeKit.git'  pod 'KeychainAccess'  pod 'pop','~> 1.0'  pod 'libPhoneNumber-iOS','~> 0.8'  pod 'AsyncdisplayKit',:git => 'https://github.com/facebook/AsyncdisplayKit.git'  pod 'Intercom'  pod 'Mixpanel-swift'  pod 'UICountingLabel'  pod 'DTFoundation'  target 'cartful-iosTests' do    inherit! :search_paths    temple8  end  target 'cartful-iosUITests' do    inherit! :search_paths    temple8  endendpost_install do |installer|    installer.pods_project.targets.each do |target|        target.build_configurations.each do |config|            config.build_settings['SWIFT_VERSION'] = '3.0'        end    endend

我需要在我的测试中引用temple8的部分,这就是我将它包含在两个测试目标中的原因.但是当我运行任何测试时,我会得到一长串错误,如下所示:

objc[83693]: Class PLBuildVersion is implemented in both
/Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator.sdk/System/library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
(0x112334998) and
/Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator.sdk/System/library/PrivateFrameworks/PhotolibraryServices.framework/PhotolibraryServices
(0x112156880). One of the two will be used. Which one is undefined.

我最初认为类的重复是由于在测试目标和应用程序目标中包含temple8引起的.但是,如果我从测试目标中删除temple8,任何时候我尝试使用@testable import …在我的测试中,我得到了一个

Failed to import brIDging header...

构建错误.这意味着测试无法找到app的桥接头中的temple8头文件.所以我不确定这里最好的方法是什么.

解决方法 据我所知,警告并不是你所做的.我想我看到其他人有同样的问题,据我所知,这是Apple最新SDK的一个问题.我说你现在可以安全地忽略它.以下是一些人有同样的问题:

> Class PLBuildVersion is implemented in both frameworks
> Class PLBuildVersion is implemented in both/Applications

请查看此answer以获取更多信息.

总结

以上是内存溢出为你收集整理的objective-c – 无法在单元测试中使用Cocoapod全部内容,希望文章能够帮你解决objective-c – 无法在单元测试中使用Cocoapod所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1020328.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存