美文网首页
CocoaPods问题总结1

CocoaPods问题总结1

作者: DefaultYuan | 来源:发表于2016-08-25 15:01 被阅读227次

    CocoaPods问题总结

    例子

    <pre>
    The dependency `` is not used in any concrete target
    The dependency AFNetworking is not used in any concrete target
    </pre>

    问题原因

    <pre>
    前两天我的OS系统升级了,所以应该执行下面命令!
    sudo gem install cocoapods --pre
    执行完上面命令之后提示!
    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>
    在创建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>

    相关文章

      网友评论

          本文标题:CocoaPods问题总结1

          本文链接:https://www.haomeiwen.com/subject/wahasttx.html