2

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?

5
  • Just use "pod update" instead of "pod install" and check if it works, let me know Commented Oct 21, 2016 at 10:53
  • @Janmenjaya I have also tried pod update command but getting same error Commented Oct 21, 2016 at 11:04
  • can you show your terminal screenshot what are you doing ? Commented Oct 21, 2016 at 11:17
  • @balkaransingh i m getting error - Savitas-Mac-mini:ufony.app.schooldiary.ios Savita$ pod install [!] Invalid Podfile file: The target Pods-School Diary already has a platform set.. # from /Users/Savita/Desktop/Savita/CitrusIntegration/Using CocoaPod/ufony.app.schooldiary.ios/Podfile:10 # ------------------------------------------- # source 'github.com/CocoaPods/Specs.git' > platform :ios, '8.1' # pod 'GoogleMaps' # ------------------------------------------- Savitas-Mac-mini:ufony.app.schooldiary.ios Savita$ Commented Oct 21, 2016 at 11:25
  • Try one way, remove the pods from your pod file, then add the again. May be that help. Commented Oct 21, 2016 at 11:41

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, But i have already solve that issue. My issue was i have declare "platform:ios,'version'" two(2) times.
1

Add target to your podfile

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

target 'YourTarget' do
   pod 'GoogleMaps'
end

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.