Jeenal Infotech

Mandatory changes to implement for CocoaPods users from version 1.0

We now have to define targets. Previously there was an available implicit target.

Previously we were not forced to explicitly define the targets in the pod file. But from the last updated version of the cocoapods(v 1.0) It is now mandatory to define the targets in our pod file.
In case, If we do not define target explicitly as mentioned below:

Example:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

pod 'AFNetworking', '~> 3.0'

We¬†would observe following error on terminal, after running the “pod install” command.

Updating local specs repositories
Analyzing dependencies
[!] The dependency `AFNetworking (= 2.6.3)` is not used in any concrete target.

 

As mentioned above, to resolve the above error we have to explicitly define the target. Please find the sample below for the same.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

target "TargetName" do
    pod 'AFNetworking', '~> 3.0'
end
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkedin
Contact us

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons