Savita Pal
Savita Pal

Reputation: 63

Error on terminal while adding pod - [!] Invalid Podfile file: The target Pods-MyApp already has a platform set

In my app i have integrated Googlemap using CocoaPod.

Now I want to integrate CitrusPay using CocoaPod but when i have execute pod install command on terminal then i am getting error - [!] Invalid Podfile file:

The target Pods-MyApp already has a platform set..

from /Users/NewFolder/Desktop/xyz.app.MyApp.ios/Podfile:10

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'

Does anyone knows how to solve this error?

Upvotes: 2

Views: 2484

Answers (3)

Sirop4ik
Sirop4ik

Reputation: 5243

I had the same issue and eventually I solved it, now my Podfile looks like this

#Alamofire - lib for HTTP requests
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target 'Fitzz' do
pod 'Alamofire', '~> 4.0'

#XCGLogger - lib for loggin output
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'XCGLogger', '~> 4.0.0'

end

I am a rookie in iOS, but this works for me

Upvotes: 0

tang
tang

Reputation: 36

i have the same question with you,and than search answer in the internet,but nothing ,so i solve question myself, step: first : sure you 'Podfile' file only have "platform:ios,'version'" one time; second : add "target 'yourtarget'do" in the file top; third : add "end" in the file bottom.

you must maintain your "Podfile" file have formatter: enter image description here

you will solve this question, wish can help you.thanks.

Upvotes: 2

Windindi
Windindi

Reputation: 412

Add target to your podfile

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

target 'YourTarget' do
   pod 'GoogleMaps'
end

Upvotes: 1

Related Questions