Add CocoaPods sudo installation note (#68542)

* Add CocoaPods sudo installation note

* Refer to instructions
This commit is contained in:
Jenn Magder 2020-10-22 13:33:35 -07:00 committed by GitHub
parent 6cab3f6008
commit f877266139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 26 deletions

View File

@ -165,23 +165,19 @@ class UserMessages {
String cocoaPodsMissing(String consequence, String installInstructions) =>
'CocoaPods not installed.\n'
'$consequence\n'
'To install:\n'
'$installInstructions';
'To install $installInstructions';
String cocoaPodsUnknownVersion(String consequence, String upgradeInstructions) =>
'Unknown CocoaPods version installed.\n'
'$consequence\n'
'To upgrade:\n'
'$upgradeInstructions';
'To upgrade $upgradeInstructions';
String cocoaPodsOutdated(String currentVersion, String recVersion, String consequence, String upgradeInstructions) =>
'CocoaPods $currentVersion out of date ($recVersion is recommended).\n'
'$consequence\n'
'To upgrade:\n'
'$upgradeInstructions';
'To upgrade $upgradeInstructions';
String cocoaPodsBrokenInstall(String consequence, String reinstallInstructions) =>
'CocoaPods installed but not working.\n'
'$consequence\n'
'To re-install CocoaPods, run:\n'
'$reinstallInstructions';
'To re-install $reinstallInstructions';
// Messages used in VsCodeValidator
String vsCodeVersion(String version) => 'version $version';

View File

@ -30,7 +30,7 @@ const String unknownCocoaPodsConsequence = '''
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.
This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.''';
This can usually be fixed by re-installing CocoaPods.''';
const String outOfDateFrameworksPodfileConsequence = '''
This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes.
@ -41,11 +41,7 @@ const String outOfDatePluginsPodfileConsequence = '''
See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms for details.
If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/45197 for instructions.''';
const String cocoaPodsInstallInstructions = '''
sudo gem install cocoapods''';
const String cocoaPodsUpgradeInstructions = '''
sudo gem install cocoapods''';
const String cocoaPodsInstallInstructions = 'see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.';
const String podfileMigrationInstructions = '''
rm ios/Podfile''';
@ -195,8 +191,7 @@ class CocoaPods {
_logger.printError(
'Warning: CocoaPods not installed. Skipping pod install.\n'
'$noCocoaPodsConsequence\n'
'To install:\n'
'$cocoaPodsInstallInstructions\n',
'To install $cocoaPodsInstallInstructions\n',
emphasis: true,
);
return false;
@ -204,8 +199,7 @@ class CocoaPods {
_logger.printError(
'Warning: CocoaPods is installed but broken. Skipping pod install.\n'
'$brokenCocoaPodsConsequence\n'
'To re-install:\n'
'$cocoaPodsUpgradeInstructions\n',
'To re-install $cocoaPodsInstallInstructions\n',
emphasis: true,
);
return false;
@ -213,8 +207,7 @@ class CocoaPods {
_logger.printError(
'Warning: Unknown CocoaPods version installed.\n'
'$unknownCocoaPodsConsequence\n'
'To upgrade:\n'
'$cocoaPodsUpgradeInstructions\n',
'To upgrade $cocoaPodsInstallInstructions\n',
emphasis: true,
);
break;
@ -222,8 +215,7 @@ class CocoaPods {
_logger.printError(
'Warning: CocoaPods minimum required version $cocoaPodsMinimumVersion or greater not installed. Skipping pod install.\n'
'$noCocoaPodsConsequence\n'
'To upgrade:\n'
'$cocoaPodsUpgradeInstructions\n',
'To upgrade $cocoaPodsInstallInstructions\n',
emphasis: true,
);
return false;
@ -231,8 +223,7 @@ class CocoaPods {
_logger.printError(
'Warning: CocoaPods recommended version $cocoaPodsRecommendedVersion or greater not installed.\n'
'Pods handling may fail on some projects involving plugins.\n'
'To upgrade:\n'
'$cocoaPodsUpgradeInstructions\n',
'To upgrade $cocoaPodsInstallInstructions\n',
emphasis: true,
);
break;

View File

@ -50,12 +50,12 @@ class CocoaPodsValidator extends DoctorValidator {
} else if (cocoaPodsStatus == CocoaPodsStatus.unknownVersion) {
status = ValidationType.partial;
messages.add(ValidationMessage.hint(
_userMessages.cocoaPodsUnknownVersion(unknownCocoaPodsConsequence, cocoaPodsUpgradeInstructions)));
_userMessages.cocoaPodsUnknownVersion(unknownCocoaPodsConsequence, cocoaPodsInstallInstructions)));
} else {
status = ValidationType.partial;
final String currentVersionText = await _cocoaPods.cocoaPodsVersionText;
messages.add(ValidationMessage.hint(
_userMessages.cocoaPodsOutdated(currentVersionText, _cocoaPods.cocoaPodsRecommendedVersion, noCocoaPodsConsequence, cocoaPodsUpgradeInstructions)));
_userMessages.cocoaPodsOutdated(currentVersionText, _cocoaPods.cocoaPodsRecommendedVersion, noCocoaPodsConsequence, cocoaPodsInstallInstructions)));
}
}