Reputation: 17007
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 being compiled, it's giving me the 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
Upvotes: 57
Views: 72092
Reputation: 3461
Just I changed App
to the correct name of the product which is Mevenda
:
target 'Mevenda' do
capacitor_pods
# Add your Pods here
pod 'FirebaseStorage'
end
Upvotes: 0
Reputation: 3255
If you are here in 2022 using SwiftUI, I just uncomment the line and specified the latest iOS version. I am using Xcode 14.0.1.
# Uncomment the next line to define a global platform for your project
platform :ios, '16.0'
Upvotes: 0
Reputation: 1517
I have a lot of schemas like below. So, we should map a schema in pod file.
Wrong : target 'MobileBranch' do
Correct : target 'Test-MobileBranch' do
Correct : target 'Main-MobileBranch' do
Upvotes: 0
Reputation: 500
make sure your current name for project in Podfile Matching with right name
target 'Project name' do
use_frameworks!
# Pods for Project name
pod 'SwiftMessages'
end
Upvotes: 1
Reputation: 562
Upvotes: 2
Reputation: 17007
After spending hours on Google just opened Podfile and found that project name is wrong. So I have just written correct project name in Podfile
and issue has been resolved.
Before:
target 'Wrong Project Name' do
pod 'Parse'
pod 'SDWebImage'
end
After:
target 'Correct Project Name' do
pod 'Parse'
pod 'SDWebImage'
end
Upvotes: 178
Reputation: 2287
In my case, the target name was the same,
but it was case sensitive wrong.
"myTarget" // podfile
"MyTarget" // Xcode
Upvotes: 1
Reputation: 777
It is due to target name changed.
just opened Podfile and replace target name with new target name.
(In my case “GoogleMapSample” was “Map Sample”,
“GoogleMapSampleTests” was “Map SampleTests”,
“GoogleMapSampleUITests” was “Map SampleUITests”,
means I just replace “Map Sample” with “GoogleMapSample” for all targets)
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'GoogleMapSample' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Alamofire', '~> 4.4’
pod 'SwiftyJSON', '~> 4.0'
# Pods for GoogleMapSample
target 'GoogleMapSampleTests' do
inherit! :search_paths
# Pods for testing
end
target 'GoogleMapSampleUITests' do
inherit! :search_paths
# Pods for testing
end
end
Upvotes: 4
Reputation: 10733
According to the error, you specify a target named ProjectName
but this does not exist in your project. Read the podfile syntax reference carefully and make sure you add the right target name (in my case it's called Tester
:)
Upvotes: 14