首页 文章

如何在Podfile中选择项目?我'm getting the error: Unable to find the Xcode project for the target ' beans 荚'

提问于
浏览
38

我正在做Ray Wenderlich教程,名为SimpleWeather .
podfile与项目位于同一文件夹中 . 这是podfile中的代码:

platform :ios, '7.0'

xcodeproj 'SimpleWeather'  

pod 'Mantle'  
pod 'LBBlurredImage'  
pod 'TSMessages'  
pod 'ReactiveCocoa'

错误信息是这样的:[!]无法找到目标 Pods 的Xcode项目 /Users/myName/Developer/SimpleWeather.xcodeproj .

该项目的名称是SimpleWeather .

9 回答

  • 1

    重申我们原来的对话:

    相应于Podfile Syntax Reference,Podfile看起来正确 .

    确保从项目目录中运行 $pod install

    /Users/myName/Developer/SimpleWeather
    
  • 3

    我很确定你不在正确的目录中 . 你确定 .xcodeproj 在Developer文件夹中吗?您可能需要导航到的子文件夹 .

    在项目中启用CocoaPods的正确方法是:

    • 打开终端并执行: $ sudo gem install cocoapods

    • 导航到您的Project文件夹(我假设您的情况是 cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj ) .

    • 设置Cocoapod pod setup

    • 创建Podfile touch Podfile

    • 打开Podfile open -e Podfile 并插入Podfile的代码

    • 最后安装Podfile pod install

    如果您遵循此说明,一切都应该有效 . 打开项目时,请确保打开 .xworkspace 文件 .

    有关更多信息,请参阅this .

  • 58

    当您的Xcode项目中有多个 .xcodeproj 时,也会发生此错误 .

    在一般情况下,您不需要多个 .xcodeproj . 删除不必要的 .xcodeproj ,之后Cocoapods会自动获取正确的路径 .

  • 0

    嘿,你的项目路径可能是错的 . 转到项目并右键单击SimpleWeather.xcodeproj并选择获取信息如下图所示(右侧窗口用于获取此处的信息) . 从详细信息窗口复制此路径并将其粘贴到Podfile中 . 之后将/SimpleWeather.xcodeproj附加到该粘贴的路径 . 这可能会解决问题(注意:这是我项目的快照) . 在您的情况下,解决方案可能正在用此 /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj 替换路径

    enter image description here

  • 14

    要解决此问题,请按照以下步骤操作,您的问题将得到解决:

    第1步:打开终端并导航到项目文件夹

    第2步: touch podfile

    第3步: open -e Podfile

    第4步:在文本编辑中写下以下行并关闭它

    工作区'Desktop / yourprojectname.xcworkspace'

    第5步:Pod安装

    成功完成后,您将不会再次出现此错误 .

    CheersKP

  • 20

    也许你有两个项目 .xcodeproj ,删除一个 .

    删除 Podfile.lock ,文件夹 Pods . 在航站楼 cd /Users/myName/Developer/SimpleWeatherpod install

  • 2

    我有同样的问题 . 然后,经过多次尝试和错误尝试,我终于找到了可行的解决方案:

    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '9.0'
    use_frameworks!
    
    target 'SimpleWeather'
    pod 'Alamofire', '~> 3.4'
    

    当你在项目目录中时(我假设你应该使用终端导航到/ Users / myName / Developer / SimpleWeather /)

  • 0

    您安装了Xcode..in应用程序使用此命令执行

    sudo xcode-select -switch /Applications/Xcode.app
    
  • 31

    好吧,我已经尝试了所有可能的事情...我只有一个.xcodeproj文件但是我无法安装,所以最后我尝试了以下
    1.使用.xcodeproj打开终端cd到你的项目文件夹
    2.键入pod init
    3.键入touch Podfile
    4.键入pod install
    魔术发生,你的pod文件安装完毕

相关问题