(Pod造成的)One of the two will be used. Which one is undefined.
来源:互联网 发布:网络棋牌游戏制作 编辑:程序博客网 时间:2024/05/22 18:55
前因
因为项目里,需要一个图表控件。项目的图表部分不是重点,没必要花费大量时间自己去写一个,所以去找第三方的图表。 安卓使用的是一个功能比较强大的第三方MPAndroidChart。ios里没有功能这么全面的,最后我找到了这个。
/Charts
Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
这个包含MPAndroidChart的所有功能。
当然这不是重点,重点是,这是个Swift写的。正好练一下混编集成吧。
用pod集成Swift第三方库,网上有很多,我就不说了。原理就是用动态库的方式,把swift项目打成framework,再链接。大家想知道的自己去查一下。
关键在于podfile ,举例:
platform :ios,’8.0’
use_frameworks!
pod 'AFNetworking'
pod 'Charts'
项目中#import<>方式导入的pod内第三方会报错 改为#import"" 或@import即可。
正文
集成好了之后,运行的时候报出这样的问题。
objc[3524]: Class AFCachedImage is implemented in both /private/var/containers/Bundle/Application/531B5E93-B456-4642-BBA6-0A8F63E43D85/Inroad.app/Frameworks/AFNetworking.framework/AFNetworking and /var/containers/Bundle/Application/531B5E93-B456-4642-BBA6-0A8F63E43D85/Inroad.app/Inroad. One of the two will be used. Which one is undefined.objc[3524]: Class AFAutoPurgingImageCache is implemented in both /private/var/containers/Bundle/Application/531B5E93-B456-4642-BBA6-0A8F63E43D85/Inroad.app/Frameworks/AFNetworking.framework/AFNetworking and /var/containers/Bundle/Application/531B5E93-B456-4642-BBA6-0A8F63E43D85/Inroad.app/Inroad. One of the two will be used. Which one is undefined.仔细看了一下所有的pod第三方文件都有类似报错。貌似是重复了。去网上找了半天,说的方法都不好使。
我自己肯定不会重复。于是就想到pod的问题。我猜测是pod改成framework编译方式,但是原来的方式也保留了,所以造成重复。新建了一个项目,用framework的方式集成了几个第三方。没有类似错误。通过对比找到了问题。
问题出在other linker flags。之前的编译方式是这样写的
-l"AFNetworking"
新工程里是这样的
-framework"AFNetworking"
把所有第三方改掉,问题解决。
0 0
- (Pod造成的)One of the two will be used. Which one is undefined.
- One of the two will be used. Which one is undefined.
- Class JavaLaunchHelper is implemented in both. One of the two will be used. Which one is undefined
- Class PLBuildVersion is implemented in both. One of the two will be used. Which one is undefined.
- [经验]Class MediaTransCoder is implemented in both One of the two will be used. Which one is undefined
- iOS 报错:objc[1334]: Class X ... One of the two will be used. Which one is undefined
- mac idea 执行报错Class JavaLaunchHelper is implemented in both *. One of the two will be used. Which one
- iOS:Class Foo is implemented in both MyApp and OtherApp. One of the two will be used. Which one is u
- Class JavaLaunchHelper is implemented in both … libinstrument.dylib. One of the two will be used. Wh
- objc[2213]: Class _NSZombie_BSXPCMessage is implemented in both ?? and ??. One of the two will be us
- objc[2213]: Class _NSZombie_BSXPCMessage is implemented in both ?? and ??. One of the two will be us
- When it comes to two corresponding names,one of them will be forces \( \)
- Which one is the faster one, innerHTML or DOM?
- UserWarning: The installed version of numexpr 2.4 is not supported in pandas and will be not be used
- 102 For which two database objects can the VERSIONS clause of the Flashback Versions Query be used?
- One or more breakpoints cannot be set and have been disabled.Execution will stop at the beginning of the program
- One or more breakpoints cannot be set and have been disabled!Execution will stop at the beginning of the program
- One or more breakpoints cannot be set and have been disable.Execution will stop at the begining of the programe
- Android-GestureDetector手势滑动
- poj 2778 DNA Sequence ac自动机+矩阵快速幂
- Mixing Milk
- ubuntu 平台上 安装 opencv实践
- Android Test
- (Pod造成的)One of the two will be used. Which one is undefined.
- 非对称加密RSA的应用及在C#中的实现
- LeetCode127—Word Ladder
- Android 自定义RecyclerView 实现真正的Gallery效果
- 你是不是想得太简单了
- 两人生日相同的概率
- 开发单页应用(SPA)时候遇到的微信支付授权目录的坑
- 关于NGUI置灰的方案
- bestcoder 1002 列变位法解密(模拟)