类是在两者中实现的,其中一个将被使用。哪一个未定义 [英] Class is implemented in both, One of the two will be used. Which one is undefined
问题描述
我对Cocoapods中包含的依赖项存在问题。
I have an issue with dependencies included in Cocoapods.
我有一个Framework项目(MyFramework目标),它还有App目标(MyFrameworkExampleApp)。当我尝试运行应用程序时,我得到一个充满错误的控制台:
I have a Framework project (MyFramework target), which also has App target (MyFrameworkExampleApp). When I try to run the app, I get a console full of errors like so:
Class PodsDummy_AFNetworking在/ private / var中实现/containers/Bundle/Application/AD85D7EC-2652-4019-94FB-C799D0FBA69B/MyFrameworkExampleApp.app/Frameworks/MyFramework.framework/MyFramework(0x1019a0438)和/ var / containers / Bundle / Application / AD85D7EC-2652-4019-94FB-C799D0FBA69B /MyFrameworkExampleApp.app/MyFrameworkExampleApp(0x10107c558)。将使用两者之一。哪一个是未定义的。
Class PodsDummy_AFNetworking is implemented in both /private/var/containers/Bundle/Application/AD85D7EC-2652-4019-94FB-C799D0FBA69B/MyFrameworkExampleApp.app/Frameworks/MyFramework.framework/MyFramework (0x1019a0438) and /var/containers/Bundle/Application/AD85D7EC-2652-4019-94FB-C799D0FBA69B/MyFrameworkExampleApp.app/MyFrameworkExampleApp (0x10107c558). One of the two will be used. Which one is undefined.
问题是,错误来自仅包含在MyFramework目标中的库
The thing is, the errors come from the libraries included only in MyFramework target
以下是我的podfile的内容:
Here are the contents of my podfile:
# Specify platform.
platform :ios, '9.0'
# Let's ignore all warnings from all pods
inhibit_all_warnings!
target 'MyFramework’ do
# ReactiveCocoa for easier binding between UI and data models.
pod 'ReactiveCocoa', '< 3.0'
# ReactiveViewModel for easier handling of active/inactive view models.
pod 'ReactiveViewModel', '0.3'
# An Objective-C extension with some nice helpers including @weakify/@strongify.
pod 'libextobjc', '~> 0.4.1'
# AFNetworking Security stuff
pod 'AFNetworking/Security', '~> 2.5.4'
# KZPropertyMapper to easily map JSON dicts to properties
pod "KZPropertyMapper"
# Simple wrapper for KeyChain
pod 'UICKeyChainStore', '~> 2.0.6'
# Animated gifs
pod 'FLAnimatedImage', '~> 1.0'
# Firebase push notifications
pod 'Firebase/Core'
pod 'Firebase/Messaging'
# Easy image downloading with cache.
pod 'SDWebImage', '~> 3.7.2'
# Activity indicator for RBSlider
pod 'DGActivityIndicatorView'
end
target 'MyFrameworkExampleApp' do
# Progress indicator
pod 'MBProgressHUD', '~> 1.0.0'
# Color picker
pod 'iOS-Color-Picker'
# Hockey SDK
pod 'HockeySDK', '~> 5.0.0'
end
如你所见,App target确实不继承任何pods,也没有任何全局pods。可能是什么原因?
As you can see, App target does not inherit any pods, nor do I have any global pods. What might be the reason for this?
推荐答案
我不知道原因,但是如果你打开你的应用程序的Pods- [ cocoapods创建的.adbug.xcconfig文件,你会发现OTHER_LDFLAGS,你会看到它链接到你在框架中链接的相同框架。因此,如果你删除-framework [Duplicated framework],警告就会消失。
I don't know the reason, but if you open your app's Pods-[AppName].debug.xcconfig file that cocoapods creates you'll find OTHER_LDFLAGS and you'll see it links to the same frameworks you link in your framework. So if you remove -framework [Duplicated framework] the warning disappears.
似乎是一个cocoapods错误
Seems to be a cocoapods error
这篇关于类是在两者中实现的,其中一个将被使用。哪一个未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!