iOS 一些遇到并填过的坑

2017-09-17  本文已影响0人  RaniysLiao

Cocoa pods相关

clang: error: linker command failed with exit code 1 (use -v to see invocation)
环境:
macOS: 10.12.6
Xcode: 8.3.3
cocoa pods version: 1.3.1
Podfile:
platform :ios, '9.0'
use_frameworks!
过程:

Case 1:
当我从我的Podfile删掉一个库,并重新pod install,在build项目时遇到报错:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

google了一下,此处提示说:一般是因为项目找不到cocoapods 的库,按照这个思路我在项目的Build Setttings/Other Linker Flags里找到了我删掉的这个库,删掉以后重新build,报错消失。

Case 2:
我在有一个项目中使用了激光推送, 并且该项目代码还是使用svn管理。一开始我使用cocopods安装使用,但是当我将代码上传svn供同事使用时,项目不能成功build,报错:

Apple Mach-O Linker Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)

经过排查发现是因为pods中激光推送的静态库.a文件丢失,这是svn管理工具的bug。这里我的处理方法是直接在terminal里手动将.a库文件加入上传:

// xxxxx为库文件名
$ svn add xxxxx.a

持续更新中...

上一篇下一篇

猜你喜欢

热点阅读