CocoaPods错误总结和解决

1. cocoaPods集成ReactiveCocoa时出现警告Pods written in Swift can only be integrated as frameworks…. 之后安装不成功

问题原因: 三方种存在swift编写的代码 没有静态库需要用frameworks 替换

解决办法: 在podFile 里这个 pod ‘ReactiveCocoa’, ‘~> 4.1.0’ #响应式编程

前一行添加use_frameworks! 使用框架即可

2. cocoaPods 集成之后ReactiveCocoa响应式编程框架报错:

1.编译时Pod文件里错误:Cannot create __weak reference in file using manual reference counting

2.引入头文件出现:Could not build module ‘ReactiveCocoa’, 不能构建ReactiveCocoa模块

解决办法:打开Target -> Build Settings -> Apple LLVM 7.1 - Language - Objective C -> Weak References in Manual Retain Release to YES.

如果还是不行的话可以在找到Build Settings ->Linking -> Other Linker Flags 看看设没设置 -Objc 和 -all_load


3.0 [摘要:设置 Project->Info->Configurations,正在Configurations内里吧Debug 战Release的Tests 的None改成pods就能够啦]

设置 Project->Info->Configurations,在Configurations里面吧Debug 和Release的Tests 的None改为pods就可以啦


4.0,embedded dylibs/frameworks are only supported on iOS 8.0 and later (@rpath/AFNetworking.framework/AFNetworking) for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

原因:主要是因为XXX的framework支持的最低开发环境为8.0,而使用该framework的工程支持版本为8.0以下(我这里的环境为4.3)

解决方法:选择低版本的开发环境,重新编译XXX的framework

CocoaPods错误总结和解决_第1张图片

5.0 Undefined symbols for architecture arm64: “_OBJC_CLASS_$_PayTabCardReaderViewController”, referenced from: objc-class-ref in ViewController.o。出现这个错误的原因有很多    通常的原因一个一个排除  还有一种是由于cocoapods造成的。在cocoapods中出现这样的警告.根据警告的提示进行操作,Go to your target Build Settings -> Other linker flags -> double click . Add $(inherited) to a new line.If you have problem with "...target overrides the GCC_PREPROCESSOR_DEFINITIONS build setting defined in..." then you must add $(inherited) to your target Build Settings -> Preprocessor Macros,添加上这个标志符号,就可以解决$(inherited)

你可能感兴趣的:(CocoaPods错误总结和解决)