How do I select a project in my Podfile? I'm getting the error: Unable to find the Xcode project for the target 'Pods'

前端 未结 10 1279
独厮守ぢ
独厮守ぢ 2020-12-02 13:27

I\'m doing the Ray Wenderlich tutorial called SimpleWeather.
The podfile is in the same folder as the project. Here\'s my code from the podfile:

platfo         


        
相关标签:
10条回答
  • 2020-12-02 13:42

    Reiterating our original conversation:

    Accordingly to Podfile Syntax Reference the Podfile looks right.

    Make sure you are running $pod install from your project directory:

    /Users/myName/Developer/SimpleWeather
    
    0 讨论(0)
  • 2020-12-02 13:42

    For people who are on Mac and also using code editors, the duplicate file that is causing this issue is ._projectname.xcodeproj because it has the same extension as the regular .xcodeproj files.

    0 讨论(0)
  • 2020-12-02 13:46

    I'm pretty sure you are not in the right directory. Are you sure your .xcodeproj is in the Developer folder? There might be a subfolder you need to navigate to.

    The right way to enable CocoaPods in your Project is:

    1. Open Terminal and execute: $ sudo gem install cocoapods
    2. Navigate to your Project folder (I assume in your case it's cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj).
    3. Setup Cocoapod pod setup
    4. Create the Podfile touch Podfile
    5. Open the Podfile open -e Podfile and insert your code for Podfile
    6. Finally install the Podfile pod install

    If you follow this instructions everything should work. When opening your project make sure to open the .xworkspacefile.

    For more information, see this.

    0 讨论(0)
  • 2020-12-02 13:50

    I had the same problem. Then with many attempts of trials and errors I finally got the working solution:

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

    This works when you are in your project directory (I assume you should navigate using terminal to /Users/myName/Developer/SimpleWeather/)

    0 讨论(0)
  • 2020-12-02 13:51

    To solve this issue, just follow below steps and your issue will get resolved :

    Step 1 : Open Terminal and navigate to your project folder

    Step 2 : touch podfile

    Step 3 : open -e Podfile

    Step 4 : Write below line in your text edit and close it

    workspace '/Users/systemName/Developer/yourprojectname/yourprojectname.xcworkspace'

    Step 5 : Pod install

    And after successful process, you will not get this error again.

    CheersKP

    0 讨论(0)
  • 2020-12-02 13:53

    so okay i had tried every possible thing ...i had only one .xcodeproj file but sill i couldnt install so finally i had tried with the following
    1. open terminal cd to your project folder one with .xcodeproj
    2. type pod init
    3. type touch Podfile
    4. type pod install
    Magic happens and your pod files gets installed

    0 讨论(0)
提交回复
热议问题