I am running XCode 7, Swift 2.0, iOS 9.
I want to install Alamofire in my project using Cocoapods. I have done the following:
gem install cocoapods
try Build For testing works for me
When installing CocoaPods, be sure to specify ios 9.0 by deleteing the #. Therefore, # platform :ios, '9.0'
should just be platform :ios, '9.0'
Then, if the error shows again, simply build and run. After you build and run, the error should not return.
Also, this can occur if you have more than one version of Xcode installed on your computer. Quit (not just close) all versions of Xcode first.
Another possible scenario: make sure the test target is defined within the scope of the parent target (not outside of it)
e.g.
target 'MyApp' do
pod 'GoogleAnalytics', '~> 3.1'
target 'MyAppTests' do
inherit! :search_paths
pod 'OCMock', '~> 2.0.1'
end
end
If instead it looks like:
target 'MyApp' do
pod 'GoogleAnalytics', '~> 3.1'
end
target 'MyAppTests' do
inherit! :search_paths
pod 'OCMock', '~> 2.0.1'
end
then you'll also receive this error.
What has helped in my case:
1) Close the project and XCode
2) In the terminal repeat command
> pod install
3) Open the project
(If it does not help, try to remove Pod/ folder before reinstalling)
Go to Product > Build and it will resolve the problem:
I had to do a Product > (Opt Click) Clean Build Folder ... then ran again and the issue was gone.