Cannot Install Cocoapods - No podfile found in the project directory

前端 未结 3 769
情歌与酒
情歌与酒 2020-12-08 01:01

I downloaded a sample project to learn how to make a UIPageViewController, and I am trying to essentially fork that project and need to add a third-party library. Right now,

相关标签:
3条回答
  • 2020-12-08 01:06

    Run the below commands to fix this.

    sudo gem install cocoapods
    then goto ios folder and run pod install
    
    0 讨论(0)
  • 2020-12-08 01:07

    If you want to add a library from GitHub to your own project, after installing gems, do firstly pod init look at from GitHub cocoapod description and then add it after target line in podfile.

    Save and run "pod install".

    It would be successfully added on your project.

    0 讨论(0)
  • 2020-12-08 01:18

    Steps to add CocoaPods to manage dependencies in your project:

    1. sudo gem install cocoapods -> This installs CocoaPods as a piece of software on your machine.

    2. Go to the root of your project directory and execute pod init -> This will add a base Podfile to your project.

    3. Add the external dependencies that you have to this Podfile by editing it.

    4. Run pod install which will fetch all the external dependencies mentioned by you, and associate it with a .xcworkspace file of your project. This .xcworkspace file will be generated for you if you already do not have one.

    From here on, you should use .xcworkspace file instead of .xcproject / .xcodeproj.

    Example Podfile Syntax:

    target 'MyApp' do   
    pod 'AFNetworking', '~> 3.0'
    end
    

    Where AFNetworking is the pod and 3.0 is the specific version that I want to install.

    Documentation: Using CocoaPods

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