18

I just started this tutorial on creating a weather app for ios. Everything was going fine until I typed pod install in the terminal to..well install the pods. The result was:

Analyzing dependencies
[!] Unable to find a target

My "podfile" document and "Pods" folder are in the same folder as my "RHSWeather.xcodeproj".

I'm using Xcode 6.1. My "podfile" document reads as follows:

platform :ios, '7.0'

xcodeproj 'RHSWeather'

pod 'Mantle', '~>1.3.1'
pod 'LBBlurredImage', '~>0.1.0'
pod 'TSMessages', '~>0.9.4'
pod 'ReactiveCocoa', '~>2.1.7'
pod 'HexColors', '~>2.2.1'

I've also changed the "podfile" document to:

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

xcodeproj 'RHSWeather'

pod 'Mantle', '~>1.3.1'
pod 'LBBlurredImage', '~>0.1.0'
pod 'TSMessages', '~>0.9.4'
pod 'ReactiveCocoa', '~>2.1.7'
pod 'HexColors', '~>2.2.1'

no luck..yet. I'm almost sure I've done the previous steps correctly.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Owen
  • 181
  • 1
  • 1
  • 4
  • The problem appears because your "Target build" is empty in your Xcode (Project file -> Targets). In Xcode 6.0+ when you create an "Empty" project (File -> New Project -> Others), it creates an totally empty project, not like in the previous versions. If you want to have an empty project like in Xcode 5, you need to create an "Single View Application" and make some changes like described here: http://stackoverflow.com/questions/25783282/how-to-create-an-empty-application-in-xcode-6-without-storyboard – Zsivics Sanel May 31 '15 at 15:10

5 Answers5

38

For me, i changed the name in Project target, pay attention, let it be the same name

Target name in project same in target Name CocoaPods

Targets NameApp Pod NameApp

YanSte
  • 10,661
  • 3
  • 57
  • 53
6

You may have forgotten to run the pod setup command.

Pranav Kasetti
  • 8,770
  • 2
  • 50
  • 71
waiter.james
  • 591
  • 2
  • 6
  • 16
2

I was able to resolve the 'Unable to find a target' error during my first try at using a pod by simply opening the .xcodeproj file and adding a target.

Sometimes the error message is useful! :-)

sean808080
  • 242
  • 4
  • 13
2

In my case, that error referred to a target that did exist, a utility target irrelevant to Cocoapods. I chose to remove this target from the Podfile that I had generated via pod init.

My utility target was, MOGenerator, for those curious.

AWrightIV
  • 553
  • 7
  • 15
1

I found this closed CocoaPods issue:

https://github.com/CocoaPods/CocoaPods/issues/1891

The solution there is to reboot your Mac. That fixed it for me.

pkamb
  • 33,281
  • 23
  • 160
  • 191
jbejar
  • 131
  • 7