Skip to content

Commit c9825d2

Browse files
authored
Handle CocoaPods ffi stderr (#102327)
1 parent c73100b commit c9825d2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/flutter_tools/lib/src/macos/cocoapods.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,19 @@ class CocoaPods {
349349
}
350350

351351
void _diagnosePodInstallFailure(ProcessResult result) {
352-
if (result.stdout is! String) {
352+
final Object? stdout = result.stdout;
353+
final Object? stderr = result.stderr;
354+
if (stdout is! String || stderr is! String) {
353355
return;
354356
}
355-
final String stdout = result.stdout as String;
356357
if (stdout.contains('out-of-date source repos')) {
357358
_logger.printError(
358359
"Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.\n"
359360
'To update the CocoaPods specs, run:\n'
360361
' pod repo update\n',
361362
emphasis: true,
362363
);
363-
} else if ((stdout.contains('ffi_c.bundle') || stdout.contains('/ffi/')) &&
364+
} else if ((stderr.contains('ffi_c.bundle') || stderr.contains('/ffi/')) &&
364365
_operatingSystemUtils.hostPlatform == HostPlatform.darwin_arm) {
365366
// https://github.com/flutter/flutter/issues/70796
366367
UsageEvent(

packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
514514
'LANG': 'en_US.UTF-8',
515515
},
516516
exitCode: 1,
517-
stdout: cocoaPodsError,
517+
stderr: cocoaPodsError,
518518
),
519519
const FakeCommand(
520520
command: <String>['which', 'sysctl'],

0 commit comments

Comments
 (0)