程序员

git仓库内容修改后pod spec lint无变化问题

2017-08-09  本文已影响0人  frog78

      搭建私有cocoapods仓库时,需要自己创建.podspec文件,并把.podspec文件上传到私有服务器上。通常在写完.podspec文件后要检查一下文件的有效性,否则传上去也是白传。这就用到了pod spec lint命令。

       在使用时遇到一个小问题。就是第一次使用pod spec lint命令检测时,提示不通过,原因是有文件不支持x86或者i386,也就是不支持模拟器。如下面log所示:

admindeMacBook-Pro-2:Desktop $ pod spec lint Detect.podspec

->Detect (1.0.0)

- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.

- NOTE| [iOS] xcodebuild:ld: warning: ignoring file

Detect/Detect/Detect.framework/Detect, missing required architecture x86_64 in file Detect/Detect/Detect.framework/Detect (2 slices)

- NOTE| [iOS] xcodebuild:ld: warning: ignoring file Detect/Detect/Detect.framework/Detect, missing required architecture i386 in file Detect/Detect/Detect.framework/Detect (2 slices)

- NOTE| [iOS] xcodebuild:fatal error: lipo: -remove's specified would result in an empty fat file

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.

        因此,去改了git仓库中相关的framework,使之支持x86或者i386。原本以为这样就可以了,但结果出乎意料,还是报原来的错误。因此又跑去改了几遍,来来回回排查了几次,发现无论怎么改,似乎pod spec lint根本就不去理会这些改变。然后就想到了缓存,猜想是不是pod spec lint是不是只会把git仓库里面的内容拉下来第一次,后面都是基于缓存跑的命令。但是缓存在什么位置呢?于是使用了下面的命令,来看命令运行的细节:

pod spec lint Detect.podspec --verbose

果然看到了缓存路径:/Users/xxx/Library/Caches/CocoaPods/Pods/External/Detect/c95d09ca6414d5ce7e95336874fb511d-6bd8e

admindeMacBook-Pro-2:Desktop $ pod spec lint Detect.podspec --verbose

Detect (1.0.0) - Analyzing on iOS 8.0 platform.

Preparing

Analyzing dependencies

Inspecting targets to integrate

Using `ARCHS` setting to build architectures of target `Pods-App`: (``)

Fetching external sources

-> Fetching podspec for `Detect` from `/Users/xxx/Desktop/Detect.podspec`

Resolving dependencies of Comparing resolved specification to the sandbox manifest

Downloading dependencies

-> Installing Detect (1.0.0)

> Copying Detect from

`/Users/xxx/Library/Caches/CocoaPods/Pods/External/Detect/c95d09ca6414d5ce7e95336874fb511d-6bd8e`

to

`../../../private/var/folders/wq/_bbgx_v55f3b1vvhw5qvch740000gn/T/CocoaPods/Lint/Pods/Detect`

- Running pre install hooks

于是果断cd到这个路径并打开,果然发现了大量的缓存数据,直接把这些数据抹掉,再去运行pod spec lint命令,就会重新去git上拉数据,从而使检验通过:

** BUILD SUCCEEDED **

->Detect (1.0.0)

Analyzed 1 podspec.

Detect.podspec passed validation.

上一篇下一篇

猜你喜欢

热点阅读