Error with cocoapods link_with after update to 1.0.0

后端 未结 3 1129
悲哀的现实
悲哀的现实 2020-12-16 10:08

I have updated cocoapods today to 1.0.0 version. I got this string when I update the pods:

[!] Invalid Podfile file: [!] The specification of link_with in the

3条回答
  •  执念已碎
    2020-12-16 10:27

    According to the new official CocoaPods specification since version 1.0 the new model is this:

    Note that BasePods is not the actual name of any target in the project.

    TargetNameOne and TargetNameTwo are the real names.

    platform :ios, '8.1'
    inhibit_all_warnings!
    
    abstract_target 'BasePods' do
        ## Networking
        pod 'AFNetworking', '~> 2.6'
    
        # Twitter
        pod 'TwitterKit', '~> 1.9'
        pod 'Fabric'
    
        # Specify your actual targets
        target 'TargetNameOne'
        target 'TargetNameTwo'
    end
    

    Edit - There is an implicit abstract target at the root of the Podfile now, so you could write the above example as:

    platform :ios, '8.1'
    inhibit_all_warnings!
    
    ## Networking
    pod 'AFNetworking', '~> 2.6'
    
    # Twitter
    pod 'TwitterKit', '~> 1.9'
    pod 'Fabric'
    
    # Specify your actual targets
    target 'TargetNameOne'
    target 'TargetNameTwo'
    
    • This is for multiple targets which is the most common case, but can be used for single target as well and I like one universal pattern.

提交回复
热议问题