Class xxx is implemented in both <项目路径...> One of the two will be used. Which one is undefined.

Class <类名> is implemented in both /Users/tencent/Library/Developer/Xcode/DerivedData/<>/Build/Products/Debug-iphonesimulator/PacketProcessor.framework/PacketProcessor (0x123...) and /Users/tencent/Library/Developer/CoreSimulator/Devices/xxx/data/Containers/Bundle/Application/xxx/xxx.app/xxx (0x321..). One of the two will be used. Which one is undefined.

运行时发生此类警告,有可能是CocoaPods造成的

1.检查podfile 添加 use_frameworks!,重新pod update

platform :ios, '9.0'
use_frameworks!

2.检查项目下的Pods目录的“Pods-.debug.xcconfig” 和 “Pods-.release.xcconfig”两个文件夹,把OTHER_LDFLAGS里的冲突的-framework信息删除,比如我这次报错的是

objc[94835]: Class PodsDummy_CocoaAsyncSocket is implemented in both <路径...>. One of the two will be used. Which one is undefined.

通过快捷键 Shift + Command + O 搜索 PodsDummy_CocoaAsyncSocket 定位到是 CocoaAsyncSocket 库,然后在 Pods-xxx.debug.xcconfigPods-xxx. release.xcconfig 里面找到 (OTHER_LDFLAGS = $(inherited) -ObjC -l"CocoaAsyncSocket" -framework "CFNetwork" -framework "Security" ) ,把 -l"CocoaAsyncSocket" 删除,再运行就没事了。

实在不行而且这个项目或Target什么库都没引入,直接把上面提到的两个文件还原算了

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

你可能感兴趣的:(Class xxx is implemented in both <项目路径...> One of the two will be used. Which one is undefined.)