Unverified Commit f8772661 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Add CocoaPods sudo installation note (#68542)

* Add CocoaPods sudo installation note

* Refer to instructions
parent 6cab3f60
...@@ -165,23 +165,19 @@ class UserMessages { ...@@ -165,23 +165,19 @@ class UserMessages {
String cocoaPodsMissing(String consequence, String installInstructions) => String cocoaPodsMissing(String consequence, String installInstructions) =>
'CocoaPods not installed.\n' 'CocoaPods not installed.\n'
'$consequence\n' '$consequence\n'
'To install:\n' 'To install $installInstructions';
'$installInstructions';
String cocoaPodsUnknownVersion(String consequence, String upgradeInstructions) => String cocoaPodsUnknownVersion(String consequence, String upgradeInstructions) =>
'Unknown CocoaPods version installed.\n' 'Unknown CocoaPods version installed.\n'
'$consequence\n' '$consequence\n'
'To upgrade:\n' 'To upgrade $upgradeInstructions';
'$upgradeInstructions';
String cocoaPodsOutdated(String currentVersion, String recVersion, String consequence, String upgradeInstructions) => String cocoaPodsOutdated(String currentVersion, String recVersion, String consequence, String upgradeInstructions) =>
'CocoaPods $currentVersion out of date ($recVersion is recommended).\n' 'CocoaPods $currentVersion out of date ($recVersion is recommended).\n'
'$consequence\n' '$consequence\n'
'To upgrade:\n' 'To upgrade $upgradeInstructions';
'$upgradeInstructions';
String cocoaPodsBrokenInstall(String consequence, String reinstallInstructions) => String cocoaPodsBrokenInstall(String consequence, String reinstallInstructions) =>
'CocoaPods installed but not working.\n' 'CocoaPods installed but not working.\n'
'$consequence\n' '$consequence\n'
'To re-install CocoaPods, run:\n' 'To re-install $reinstallInstructions';
'$reinstallInstructions';
// Messages used in VsCodeValidator // Messages used in VsCodeValidator
String vsCodeVersion(String version) => 'version $version'; String vsCodeVersion(String version) => 'version $version';
......
...@@ -30,7 +30,7 @@ const String unknownCocoaPodsConsequence = ''' ...@@ -30,7 +30,7 @@ const String unknownCocoaPodsConsequence = '''
const String brokenCocoaPodsConsequence = ''' const String brokenCocoaPodsConsequence = '''
You appear to have CocoaPods installed but it is not working. 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 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 = ''' 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. 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 = ''' ...@@ -41,11 +41,7 @@ const String outOfDatePluginsPodfileConsequence = '''
See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms for details. 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.'''; If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/45197 for instructions.''';
const String cocoaPodsInstallInstructions = ''' const String cocoaPodsInstallInstructions = 'see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.';
sudo gem install cocoapods''';
const String cocoaPodsUpgradeInstructions = '''
sudo gem install cocoapods''';
const String podfileMigrationInstructions = ''' const String podfileMigrationInstructions = '''
rm ios/Podfile'''; rm ios/Podfile''';
...@@ -195,8 +191,7 @@ class CocoaPods { ...@@ -195,8 +191,7 @@ class CocoaPods {
_logger.printError( _logger.printError(
'Warning: CocoaPods not installed. Skipping pod install.\n' 'Warning: CocoaPods not installed. Skipping pod install.\n'
'$noCocoaPodsConsequence\n' '$noCocoaPodsConsequence\n'
'To install:\n' 'To install $cocoaPodsInstallInstructions\n',
'$cocoaPodsInstallInstructions\n',
emphasis: true, emphasis: true,
); );
return false; return false;
...@@ -204,8 +199,7 @@ class CocoaPods { ...@@ -204,8 +199,7 @@ class CocoaPods {
_logger.printError( _logger.printError(
'Warning: CocoaPods is installed but broken. Skipping pod install.\n' 'Warning: CocoaPods is installed but broken. Skipping pod install.\n'
'$brokenCocoaPodsConsequence\n' '$brokenCocoaPodsConsequence\n'
'To re-install:\n' 'To re-install $cocoaPodsInstallInstructions\n',
'$cocoaPodsUpgradeInstructions\n',
emphasis: true, emphasis: true,
); );
return false; return false;
...@@ -213,8 +207,7 @@ class CocoaPods { ...@@ -213,8 +207,7 @@ class CocoaPods {
_logger.printError( _logger.printError(
'Warning: Unknown CocoaPods version installed.\n' 'Warning: Unknown CocoaPods version installed.\n'
'$unknownCocoaPodsConsequence\n' '$unknownCocoaPodsConsequence\n'
'To upgrade:\n' 'To upgrade $cocoaPodsInstallInstructions\n',
'$cocoaPodsUpgradeInstructions\n',
emphasis: true, emphasis: true,
); );
break; break;
...@@ -222,8 +215,7 @@ class CocoaPods { ...@@ -222,8 +215,7 @@ class CocoaPods {
_logger.printError( _logger.printError(
'Warning: CocoaPods minimum required version $cocoaPodsMinimumVersion or greater not installed. Skipping pod install.\n' 'Warning: CocoaPods minimum required version $cocoaPodsMinimumVersion or greater not installed. Skipping pod install.\n'
'$noCocoaPodsConsequence\n' '$noCocoaPodsConsequence\n'
'To upgrade:\n' 'To upgrade $cocoaPodsInstallInstructions\n',
'$cocoaPodsUpgradeInstructions\n',
emphasis: true, emphasis: true,
); );
return false; return false;
...@@ -231,8 +223,7 @@ class CocoaPods { ...@@ -231,8 +223,7 @@ class CocoaPods {
_logger.printError( _logger.printError(
'Warning: CocoaPods recommended version $cocoaPodsRecommendedVersion or greater not installed.\n' 'Warning: CocoaPods recommended version $cocoaPodsRecommendedVersion or greater not installed.\n'
'Pods handling may fail on some projects involving plugins.\n' 'Pods handling may fail on some projects involving plugins.\n'
'To upgrade:\n' 'To upgrade $cocoaPodsInstallInstructions\n',
'$cocoaPodsUpgradeInstructions\n',
emphasis: true, emphasis: true,
); );
break; break;
......
...@@ -50,12 +50,12 @@ class CocoaPodsValidator extends DoctorValidator { ...@@ -50,12 +50,12 @@ class CocoaPodsValidator extends DoctorValidator {
} else if (cocoaPodsStatus == CocoaPodsStatus.unknownVersion) { } else if (cocoaPodsStatus == CocoaPodsStatus.unknownVersion) {
status = ValidationType.partial; status = ValidationType.partial;
messages.add(ValidationMessage.hint( messages.add(ValidationMessage.hint(
_userMessages.cocoaPodsUnknownVersion(unknownCocoaPodsConsequence, cocoaPodsUpgradeInstructions))); _userMessages.cocoaPodsUnknownVersion(unknownCocoaPodsConsequence, cocoaPodsInstallInstructions)));
} else { } else {
status = ValidationType.partial; status = ValidationType.partial;
final String currentVersionText = await _cocoaPods.cocoaPodsVersionText; final String currentVersionText = await _cocoaPods.cocoaPodsVersionText;
messages.add(ValidationMessage.hint( messages.add(ValidationMessage.hint(
_userMessages.cocoaPodsOutdated(currentVersionText, _cocoaPods.cocoaPodsRecommendedVersion, noCocoaPodsConsequence, cocoaPodsUpgradeInstructions))); _userMessages.cocoaPodsOutdated(currentVersionText, _cocoaPods.cocoaPodsRecommendedVersion, noCocoaPodsConsequence, cocoaPodsInstallInstructions)));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment