Skip to content

pod setup does not work for Cocoapods 1.8.0 #41253

Closed

Description

@wliumelb

I was doing a fresh Flutter installation on a new Mac.

Following the instructions of Flutter doctor to install cocoapods with sudo gem install cocoapods, Cocoapods 1.8.0 was installed.
Then after running pod setup, nothing happened, and cocoapods was still not initialised.

The solution was to remove cocoapods with sudo gem uninstall cocoapods and then install Cocoapods 1.7.5 with sudo gem install cocoapods -v 1.7.5, then pod setup.

I know this is probably a Cocoapods issue, but the flutter doctor instructions need to change so new users can get Flutter to work without any trouble.

Activity

  1. stuartmorgan-g commented on Sep 25, 2019

    @stuartmorgan-g
    Contributor

    It looks like our initialization check is looking for the local repo, but 1.8.0 uses the CDN by default which doesn't require it, so it's likely that pod setup is no longer pulling it down.

    We'll need to figure out how we want to handle this (assuming that is indeed what's going on). We should likely switch our Podspec template to use the CDN, but we'll need to see what is needed to handle projects with an existing Podspec (e.g., does Cocoapods now fetch it on demand when it encounters a Podspec using it?) and update the setup check accordingly, or we'll need to migrate existing Podspecs.

    /cc @jmagman

  2. added
    p: toolingAffects the flutter_plugin_tools package
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-macosBuilding on or for macOS specifically
    platform-iosiOS applications specifically
    on Sep 25, 2019
  3. blackholegalaxy commented on Sep 27, 2019

    @blackholegalaxy

    Same here with 1.8.1. pod setup does nothing. Rollbacking to 1.7.5 was a successful workaround.

  4. davidcavazos commented on Sep 27, 2019

    @davidcavazos

    I'm also getting this issue with 1.8.1, I can also confirm installing cocoapods 1.7.5 fixes it. Make sure to uninstall previous versions or it won't work! :)

    1. sudo gem uninstall cocoapods

      If using brew, run this too: brew uninstall cocoapods

    2. sudo gem install cocoapods -v 1.7.5
    3. pod setup
    4. flutter doctor -v

    Maybe there should be a (temporary) note in the docs in the iOS setup while this is fixed.

    Edit: version 1.8.1 is now working as expected so no need for this workaround, see #41491

  5. jmagman commented on Sep 27, 2019

    @jmagman
    Member

    We'll need to figure out how we want to handle this (assuming that is indeed what's going on). We should likely switch our Podspec template to use the CDN, but we'll need to see what is needed to handle projects with an existing Podspec (e.g., does Cocoapods now fetch it on demand when it encounters a Podspec using it?) and update the setup check accordingly, or we'll need to migrate existing Podspecs.

    It uses the CDN by default as of 1.8.0. What would need to be migrated in the Podfile (assuming you meant Podfile and not podspec)?

  6. jmagman commented on Sep 27, 2019

    @jmagman
    Member

    Maybe there should be a (temporary) note in the docs in the iOS setup while this is fixed.

    flutter/website#3041

  7. stuartmorgan-g commented on Sep 27, 2019

    @stuartmorgan-g
    Contributor

    What would need to be migrated in the Podfile (assuming you meant Podfile and not podspec)?

    Turns out nothing; I was thinking of the release notes mentioning changing the source:

    - source 'https://github.com/CocoaPods/Specs.git'
    + source 'https://cdn.cocoapods.org/'
    

    and assumed we had that in our Podfile. But I was just remembering seeing the commented-out CDN source line.

    So does that mean all we need to do here is make 1.8 the minimum and remove the check that the local repo is checked out (and the corresponding instructions)?

  8. jmagman commented on Sep 27, 2019

    @jmagman
    Member

    So does that mean all we need to do here is make 1.8 the minimum and remove the check that the local repo is checked out (and the corresponding instructions)?

    Check out #41491. I skipped the local check then the version is >= 1.8. I removed the pod setup instructions from the installer comment, but they will pod setup instructions if they run again with an installed, uninitialized version < 1.8.

  9. jeyj31 commented on Sep 28, 2019

    @jeyj31

    Hi everyone,

    I'm currently trying to install flutter on my macOS but I can't install the CocoaPods even with your advices and all things I could find on internet

    someone could please help me ?

    attached, the screenshot of my terminal

    Capture d’écran 2019-09-28 à 15 19 07

  10. blackholegalaxy commented on Sep 28, 2019

    @blackholegalaxy

    Hi everyone,

    I'm currently trying to install flutter on my macOS but I can't install the CocoaPods even with your advices and all things I could find on internet

    As stated in #41253 (comment) you have to uninstall any previous version of cocoapods and install specific 1.7.5 version. You also ensure you didn't have any version installed through homebrew which could interfer with the gem one.

  11. jeyj31 commented on Sep 29, 2019

    @jeyj31

    Ok and for uninstall home-brew there is the same command ?

  12. blackholegalaxy commented on Sep 29, 2019

    @blackholegalaxy

    Ok and for uninstall home-brew there is the same command ?

    brew uninstall cocoapods

  13. paulgillingwater commented on Sep 30, 2019

    @paulgillingwater

    Hi everyone,

    I'm currently trying to install flutter on my macOS but I can't install the CocoaPods even with your advices and all things I could find on internet

    someone could please help me ?

    attached, the screenshot of my terminal

    Capture d’écran 2019-09-28 à 15 19 07

    I had exactly the same problem and solved it as follows: (assuming you installed two versions of Cocoapod):

    sudo gem uninstall cocoapods

    Select gem to uninstall:

    1. cocoapods-1.7.5
    2. cocoapods-1.8.1
    3. All versions

    2
    Successfully uninstalled cocoapods-1.8.1
    Smackbook:development paul$ pod setup
    Setting up CocoaPods master repo
    $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git --progress -- master
    Cloning into 'master'...
    remote: Enumerating objects: 299, done.
    remote: Counting objects: 100% (299/299), done.
    remote: Compressing objects: 100% (285/285), done.

  14. coldix commented on Oct 5, 2019

    @coldix

    Thanks Paul, I had the same problem, this fixed it :)
    cocoapods-fix

  15. davidair commented on Oct 7, 2019

    @davidair

    Folks, please avoid downgrading CocoaPods to work around a "flutter doctor" issue - CocoaPods 1.8+ usage of CDN is a fantastic feature and an outstanding performance optimization. Unless something is broken, try using the latest version (also, #41491 has the fix for Flutter).

  16. jmagman commented on Oct 7, 2019

    @jmagman
    Member

    Folks, please avoid downgrading CocoaPods to work around a "flutter doctor" issue - CocoaPods 1.8+ usage of CDN is a fantastic feature and an outstanding performance optimization. Unless something is broken, try using the latest version (also, #41491 has the fix for Flutter).

    It's not just a flutter doctor issue, it's a flutter build/run issue. When the local repo isn't present pod install is skipped. 1eb1e22 is in v1.10.7, so once that hits stable the -v 1.7.5 instruction and note can be removed.

  17. blackholegalaxy commented on Oct 7, 2019

    @blackholegalaxy

    Since the MR to fix that on 1.8+ detection, maybe it could be useful to include that as hotfix in current/next stable.

  18. added a commit that references this issue on Oct 8, 2019
  19. hsss1924 commented on Oct 10, 2019

    @hsss1924

    thanks,,,i fixed it

  20. jmagman commented on Oct 11, 2019

    @jmagman
    Member

    Since the MR to fix that on 1.8+ detection, maybe it could be useful to include that as hotfix in current/next stable.

    We're evaluating hotfixing this to stable.

  21. kwight commented on Oct 13, 2019

    @kwight

    If people are feeling confident, another option is to run the dev channel for now, which has received the fix in #41491 mentioned by @davidair .

    flutter channel dev
    flutter upgrade
  22. samchang8826 commented on Oct 13, 2019

    @samchang8826

    If people are feeling confident, another option is to run the dev channel for now, which has received the fix in #41491 mentioned by @davidair .

    flutter channel dev
    flutter upgrade

    After I switch to dev branch, I got a lots of issues
    so my suggestion is create fake folder under ~/.cocoapods/respos/master , it's fast and easy solution.

  23. jmagman commented on Oct 17, 2019

    @jmagman
    Member

    This fix is now in stable as v1.9.1+hotfix.5.

  24. cs145442 commented on May 25, 2021

    @cs145442

    I'm also getting this issue with 1.8.1, I can also confirm installing cocoapods 1.7.5 fixes it. Make sure to uninstall previous versions or it won't work! :)

    1. sudo gem uninstall cocoapods

      If using brew, run this too: brew uninstall cocoapods

    2. sudo gem install cocoapods -v 1.7.5
    3. pod setup
    4. flutter doctor -v

    Maybe there should be a (temporary) note in the docs in the iOS setup while this is fixed.

    Edit: version 1.8.1 is now working as expected so no need for this workaround, see #41491

    Coming from linux, as per observation...
    Do not use sudo to use flutter. latest version of cocoapods with CDN works fine. Thanks.

  25. github-actions commented on Aug 1, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  26. locked as resolved and limited conversation to collaborators on Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: toolingAffects the flutter_plugin_tools packageplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions