安装CocoaPods时遇到问题-已经在其他地方尝试了解决方案



我在安装CocoaPods时遇到问题。我已经在谷歌上搜索了一个解决方案,并遵循了我如何在我的Podfile中选择项目的答案?I'm得到错误:无法找到目标'Pods'的Xcode项目。谁能说我哪里做错了吗?

Michaels-MacBook-Air:~ michael$ cd  ~/Documents/Chinese Restaurants/
Michaels-MacBook-Air:Chinese Restaurants michael$ pod install
[in /Users/michael]
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
    xcodeproj 'path/to/Project.xcodeproj'
Michaels-MacBook-Air:Chinese Restaurants michael$ cd  ~/Documents/Chinese Restaurants/Chinese Restaurants.xcodeproj/
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ touch Podfile
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ open -e Podfile
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ pod install
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
    xcodeproj 'path/to/Project.xcodeproj'

在我的情况下,错误是因为我在Xcode项目中有两个 .xcodeproj文件。

所以解决方案是删除不必要的.xcodeproj文件,然后再次执行

pod install

我尝试在vim中编辑文件,如https://www.youtube.com/watch?v=9_FbAlq2g9o,并解决了这个问题。

解决方案如下:事实上,解决方案已经被清楚地展示出来了。

 Could not automatically select an Xcode project. Specify one in your Podfile like so:
xcodeproj 'path/to/Project.xcodeproj'
我不明白上面的提示。后来我明白了。

首先,您应该运行终端并将cd放入项目的目录中。其次,输入"vim podfile"并运行。第三,点击"i"按钮,切换到编辑模式。第四,现在你可以输入'xcodeproj projectname.xcodeproj'然后,单击ESC并输入':wq'。它的意思是保存和退出。最后,您重新输入'pod install',它将正常运行。

相关内容

最新更新