Aamir Aamir - 2 months ago 10
Objective-C Question

Unable to find a target named `ProjectName`

I added new pod in PodFile and ran command

pod install


It deleted all previous pods and failed with following error

Unable to find a target named `ProjectName`


However I recovered all deleted pods by using
Git
, but now my project is not compiling, its giving me following error


/Users/userName/Library/Developer/Xcode/DerivedData/Project_Name-fhktwvetozjdorboqdzfwlpzrcyw/Build/Intermediates/Project_Name.build/Debug-iphonesimulator/Project_Name.build/Script-D7BB987C75C5AEC6033AA28E.sh:
/Users/userName/Desktop/iOS_Workspace/Project_Name/Pods/Target Support
Files/Pods-Project_Name/Pods-Project_Name-resources.sh: /bin/sh^M: bad
interpreter: No such file or directory


I tried every solution regarding pods, but neither worked for me.

Any help will be appreciated. Thanks

Answer

After spending many hours on Google just opened Podfile and seen that project name is wrong. So I have just written correct project name in Podfile and issue resolved for me.

Before:

target 'Wrong Project Name' do
    pod 'Parse'
    pod 'SDWebImage'
end

After:

target 'Correct Project Name' do
    pod 'Parse'
    pod 'SDWebImage'
end