您的位置:首页 > 其它

CocoaPods报错:The dependency `AFNetworking ` is not used in any concrete target

2016-06-03 10:54 459 查看
前几天电脑重装了系统,CocoaPods报错!

<code class="hljs coffeescript has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"></code><p class="p1"><span class="s1">[!] The dependency `SDWebImage` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Reachability` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `JSONModel` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `MBProgressHUD` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Masonry` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `HexColors` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `SVProgressHUD` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `FastAnimationWithPOP` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `CocoaSecurity` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Toast` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `JSPatch (~> 1.0)` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `WebViewJavascriptBridge (~> 4.1.4)` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `NJKWebViewProgress` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `MJRefresh` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `MJExtension` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `UMengAnalyticsSDK` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `UMengFeedbackSDK` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Bugtags` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `YYKit` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `CocoaLumberjack` is not used in any concrete target.</span></p><p class="p2"><span class="s1"></span>
</p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer/analyzer.rb:164:in `validate_podfile!'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer/analyzer.rb:62:in `analyze'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:227:in `analyze'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:151:in `block in resolve_dependencies'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/user_interface.rb:63:in `section'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:150:in `resolve_dependencies'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:114:in `install!'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command/update.rb:60:in `run'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in `run'</span></p><p class="p3"><span class="s1">/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/bin/pod:55:in `<top (required)>'</span></p><p class="p3"><span class="s1">/usr/local/bin/pod:23:in `load'</span></p><p class="p3"><span class="s1">/usr/local/bin/pod:23:in `<main>'</span></p><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul>

提示,大概就是我的版本不是 last version,就是下面这个:
<code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> gem install cocoapods --pre</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>


安装cocoapods的预览版本,就会更新下来新的1.0.1版本,如下所示:
<code class="hljs avrasm has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"></code><p class="p1"><span class="s1">Successfully installed cocoapods-1.0.1</span></p><p class="p1"><span class="s1">Parsing documentation for cocoapods-1.0.1</span></p><span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;"></span><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul>


更新了新的版本,出错如下:
<code class="hljs coffeescript has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">Updating local specs repositories
Analyzing dependencies
</code><p class="p1"><span class="s1">[!] The dependency `SDWebImage` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Reachability` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `JSONModel` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `MBProgressHUD` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Masonry` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `HexColors` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `SVProgressHUD` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `FastAnimationWithPOP` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `CocoaSecurity` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Toast` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `JSPatch (~> 1.0)` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `WebViewJavascriptBridge (~> 4.1.4)` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `NJKWebViewProgress` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `MJRefresh` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `MJExtension` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `UMengAnalyticsSDK` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `UMengFeedbackSDK` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `Bugtags` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `YYKit` is not used in any concrete target.</span></p><p class="p1"><span class="s1">The dependency `CocoaLumberjack` is not used in any concrete target.</span></p><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li></ul>


官网是这样给推荐的: 

在创建Podfile的时候,用这种格式使用,
<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">platform</span> :ios, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'8.0'</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#use_frameworks!个别需要用到它,比如reactiveCocoa</span>

target <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'MyApp'</span> <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">do</span>
pod <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'AFNetworking'</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'~> 2.6'</span>
pod <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'ORStackView'</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'~> 3.0'</span>
pod <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'SwiftyJSON'</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'~> 2.3'</span>
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">end</span></span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li></ul>

里面的 MyApp 记得替换为自己攻城里面的target。这样就基本OK了,执行pod install / pod update 就都可以了。(use_frameworks! 这个是个别需要的,这里修改一下,可以把我上面的代码中的这一行【删除】)

下面是另外一种写法,
<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">platform</span> :ios, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'8.0'</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#use_frameworks!个别需要用到它,比如reactiveCocoa</span>

def pods
pod <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'AFNetworking'</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'~> 2.6'</span>
pod <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'ORStackView'</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'~> 3.0'</span>
pod <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'SwiftyJSON'</span>, <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'~> 2.3'</span>
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">end</span></span>
target <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'MyApp'</span> <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">do</span>
pods
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">end</span></span></code>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: