Check for CocoaPods installation if required (#8666)
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index aa3e8c8..9e85f8b 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -317,8 +317,18 @@ return true; } +bool _checkCocoaPodsInstalled() { + if (!platform.isMacOS) + return false; + return exitsHappy(<String>['pod', '--version']); +} + void _installCocoaPods(Directory bundle, String engineDirectory) { if (fs.file(fs.path.join(bundle.path, 'Podfile')).existsSync()) { + if (!_checkCocoaPodsInstalled()) { + printError('Warning: CocoaPods not installed. Not running pod install.'); + return; + } runCheckedSync( <String>['pod', 'install'], workingDirectory: bundle.path,