我发现我错了。
我正在编写完整的步骤步骤(尤其是对于新手-(swift 5,xcode 10.2,我的项目名称-cocoapo)。另外,我正在使用 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.
现在,故障排除-如果出现任何问题:-
clear derived data, clean build folder, close xcode. In terminal do pod update. reopen xcode. It should work.