Skip to content

Conversation

@christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Aug 14, 2019

Description

When CocoaPods are installed they are dependent on a specific version of ruby. If the pod script is invoked while a different version of ruby is set as the default, it will fail with an error message. The most common cause for this is upgrading macOS, which changes the system ruby version, however it can happen in other situations (the most annoying of which is the RVM situation). sudo gem install cocoapods will usually fix this, but I added a link to the issue which has various variations of fixes.

Related Issues

Fixes this issue.

Tests

I added the following tests:

Replace this with a list of the tests that you added as part of this PR. A change in behaviour with no test covering it
will likely get reverted accidentally sooner or later. PRs must include tests for all changed/updated/fixed behaviors. See [Test Coverage].

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read [Handling breaking changes]). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 14, 2019
@christopherfujino christopherfujino force-pushed the update-cocoapods-validator branch from 4bc1133 to 51561ef Compare August 22, 2019 20:35
@codecov
Copy link

codecov bot commented Aug 22, 2019

Codecov Report

Merging #38560 into master will increase coverage by 0.29%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #38560      +/-   ##
==========================================
+ Coverage   56.34%   56.63%   +0.29%     
==========================================
  Files         195      195              
  Lines       18355    18363       +8     
==========================================
+ Hits        10342    10400      +58     
+ Misses       8013     7963      -50
Flag Coverage Δ
#flutter_tool 56.63% <55.55%> (+0.29%) ⬆️
Impacted Files Coverage Δ
...ages/flutter_tools/lib/src/base/user_messages.dart 49.05% <0%> (-0.47%) ⬇️
...utter_tools/lib/src/macos/cocoapods_validator.dart 81.81% <33.33%> (-7.66%) ⬇️
...ackages/flutter_tools/lib/src/macos/cocoapods.dart 85.98% <80%> (-1.4%) ⬇️
packages/flutter_tools/lib/src/base/utils.dart 85.64% <0%> (-7.43%) ⬇️
packages/flutter_tools/lib/src/version.dart 90.9% <0%> (-1.92%) ⬇️
...ckages/flutter_tools/lib/src/base/file_system.dart 67.85% <0%> (-1.79%) ⬇️
packages/flutter_tools/lib/src/cache.dart 43.02% <0%> (-0.73%) ⬇️
packages/flutter_tools/lib/src/base/logger.dart 82.06% <0%> (-0.39%) ⬇️
packages/flutter_tools/lib/src/vmservice.dart 38.07% <0%> (+0.76%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98ef956...548b091. Read the comment docs.

@codecov
Copy link

codecov bot commented Aug 22, 2019

Codecov Report

Merging #38560 into master will decrease coverage by 0.22%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #38560      +/-   ##
==========================================
- Coverage   56.34%   56.12%   -0.23%     
==========================================
  Files         195      195              
  Lines       18355    18362       +7     
==========================================
- Hits        10342    10305      -37     
- Misses       8013     8057      +44
Flag Coverage Δ
#flutter_tool 56.12% <55.55%> (-0.23%) ⬇️
Impacted Files Coverage Δ
...ages/flutter_tools/lib/src/base/user_messages.dart 47.16% <0%> (-2.36%) ⬇️
...utter_tools/lib/src/macos/cocoapods_validator.dart 81.81% <33.33%> (-7.66%) ⬇️
...ackages/flutter_tools/lib/src/macos/cocoapods.dart 85.98% <80%> (-1.4%) ⬇️
.../flutter_tools/lib/src/android/android_studio.dart 13.74% <0%> (-36.26%) ⬇️
...ackages/flutter_tools/lib/src/commands/attach.dart 47.05% <0%> (-27.28%) ⬇️
.../flutter_tools/lib/src/runner/flutter_command.dart 76.75% <0%> (-3.08%) ⬇️
packages/flutter_tools/lib/src/version.dart 90.9% <0%> (-1.92%) ⬇️
packages/flutter_tools/lib/src/cache.dart 43.02% <0%> (-0.73%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98ef956...10e98ee. Read the comment docs.

@christopherfujino christopherfujino marked this pull request as ready for review August 22, 2019 22:07
} else if (cocoaPodsStatus == CocoaPodsStatus.brokenInstall) {
status = ValidationType.missing;
messages.add(ValidationMessage.error(
userMessages.cocoaPodsBrokenInstall(brokenCocoaPodsConsequence, cocoaPodsInstallInstructions)));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: considering making cocoaPodsBrokenInstall if the consequence and instructions don't change.

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit


const String brokenCocoaPodsConsequence = '''
You appear to have CocoaPods installed but it is not working.
This can happen if the version of ruby that CocoaPods was installed with is different from the one being used to invoke it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby capitalized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@christopherfujino christopherfujino merged commit d1e0273 into flutter:master Aug 23, 2019
@christopherfujino christopherfujino deleted the update-cocoapods-validator branch August 23, 2019 16:21
@zanderso zanderso mentioned this pull request Oct 16, 2019
zanderso added a commit that referenced this pull request Oct 17, 2019
* refactor cocoapods validator to detect broken install (#38560)
* Skip pod initialization if version >= 1.8.0. (#41491)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading flutter doctor message about cocoapods

5 participants