1

I know this question has been asked before here - Cocoapods: "No Xcode project found, please specify one!" , but it still did not help me. I i) called - sudo gem install cocoapods ii) changed directory by dragging the project into terminal. I did this by typing cd and then dragging cocoapo.xcodeproj (highlighted in blue in the image below) to the terminal - enter image description here

iii) called pod setup. Now, when I call pod init, it shows error as shown in the terminal image below. What am I doing wrong ? If you need further information, I will be more than happy to help you.

1 Answer 1

1

I found out where I was wrong.

I am writing complete steps Steps (especially for newbies- (swift 5, xcode 10.2, my project name - cocoapo). Also, I am using Firebase.

 i) In the terminal type "sudo gem install cocoapods", press return. ii)open xcode. Right-click on the projectname( in my case cocoaopo) , then click on "show in finder" iii)I was supposed to select all the 4 cocoapo files from the finder, go to files->new folder with selection(4 items), iv)then drag that folder to desktop v) Renaname that folder (now on the deskktop) to the oririginal projectname( in my case, I had named it cococpo). vi) Go to terminal - a)type cd, give a blankspace, drag the project from the desktop to the terminal to give the complete path of the project. so, in the terminal, complete thing printed was - cd /Users/apple/Desktop/cocoapo b) type "pod init" in the terminal. press return. c) type "open podfile" in the terminal. press return. Now, the podfile opens. d) In the podfile(not textEdit), type the following(eg. for my project name is cocoapo, ios 10.2) - platform :ios, '9.0' target 'cocoapo' do use_frameworks! pod 'Firebase/Core' end e) This step is very important - Xcode should be closed. You must SAVE the podfile, then completely CLOSE the podfile as well. f)Now, type "pod install" in the terminal. return key. g) Again one more important step - you should open the file as .xcworkspace, not .xcodeproject. This is how yu shuld do it - open xcode. Right-click on the projectname( in my case cocoaopo) , then click on "show in finder". now you will see "yourprojectname.xcworkspace" (in my case it was "cocoapo.xcworkspace") in finder. open that. 

Now , troubleshooting - If anything goes wrong:-

 clear derived data, clean build folder, close xcode. In terminal do pod update. reopen xcode. It should work. 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.