CocoaPods問題總結
例子
<pre>
The dependency `` is not used in any concrete target
The dependency AFNetworking
is not used in any concrete target
</pre>
問題原因
<pre>
前兩天我的OS系統(tǒng)升級了空郊,所以應該執(zhí)行下面命令!
sudo gem install cocoapods --pre
執(zhí)行完上面命令之后提示!
Successfully installed cocoapods-1.0.0.beta.2
Parsing documentation for cocoapods-1.0.0.beta.2
</pre>
<pre>
更新了新的版本荧降,然而pod install就出錯了,悲了個勗芏痢朵诫!出錯如下:
Updating local specs repositories
Analyzing dependencies
[!] The dependency FMDB (~> 2.3)
is not used in any concrete target.
The dependency SDWebImage (~> 3.6)
is not used in any concrete target.
The dependency AFNetworking (~> 2.3.0)
is not used in any concrete target.
The dependency DACircularProgress (~> 2.2.0)
is not used in any concrete target.
The dependency MBProgressHUD (~> 0.8)
is not used in any concrete target.
The dependency PSTCollectionView (~> 1.2.1)
is not used in any concrete target.
The dependency HPGrowingTextView (~> 1.1)
is not used in any concrete target.
The dependency ProtocolBuffers (= 1.9.3)
is not used in any concrete target.
The dependency leveldb-library (~> 1.18.1)
is not used in any concrete target.
The dependency SCLAlertView-Objective-C (~> 0.7.5)
is not used in any concrete target.
The dependency MWPhotoBrowser (~> 1.4.1)
is not used in any concrete target.
The dependency MMMarkdown (~> 0.5)
is not used in any concrete target.
The dependency MJExtension (~> 2.5.16)
is not used in any concrete target.
The dependency MJRefresh (~> 2.4.12)
is not used in any concrete target.
The dependency Masonry (~> 0.6.3)
is not used in any concrete target.
出這個錯是告訴我們我們所用的庫沒有指定target,它不知道用在哪里薄扁,所以就給報錯了
</pre>
解決方案
<pre>
在創(chuàng)建Podfile的時候剪返,用這種格式使用:
</pre>
<pre>
platform :ios, '8.0'
use_frameworks!個別需要用到它,比如reactiveCocoa
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
</pre>
<pre>
另外一種寫法:
</pre>
<pre>
platform :ios, '8.0'
use_frameworks!個別需要用到它邓梅,比如reactiveCocoa
def pods
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
target 'MyApp' do
pods
end
</pre>