diff --git a/packages/shorebird_cli/lib/src/artifact_builder.dart b/packages/shorebird_cli/lib/src/artifact_builder.dart index 3cdf6699..a3c89e19 100644 --- a/packages/shorebird_cli/lib/src/artifact_builder.dart +++ b/packages/shorebird_cli/lib/src/artifact_builder.dart @@ -372,8 +372,7 @@ Please file a bug at https://github.com/shorebirdtech/shorebird/issues/new with // error: exportArchive: Communication with Apple failed // error: exportArchive: No signing certificate "iOS Distribution" found // error: exportArchive: Communication with Apple failed - final exportArchiveRegex = RegExp(r'error: exportArchive: (.+)$'); - + final exportArchiveRegex = RegExp(r'error: exportArchive:? (.+)$'); return stderr .split('\n') .map((l) => l.trim()) diff --git a/packages/shorebird_cli/lib/src/commands/patch/android_patcher.dart b/packages/shorebird_cli/lib/src/commands/patch/android_patcher.dart index d0b86a2d..d428c138 100644 --- a/packages/shorebird_cli/lib/src/commands/patch/android_patcher.dart +++ b/packages/shorebird_cli/lib/src/commands/patch/android_patcher.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'dart:io'; import 'package:crypto/crypto.dart'; -import 'package:io/io.dart'; import 'package:mason_logger/mason_logger.dart'; import 'package:path/path.dart' as p; import 'package:shorebird_cli/src/archive_analysis/android_archive_differ.dart'; diff --git a/packages/shorebird_cli/test/src/artifact_builder_test.dart b/packages/shorebird_cli/test/src/artifact_builder_test.dart index 0e90ac4d..70909458 100644 --- a/packages/shorebird_cli/test/src/artifact_builder_test.dart +++ b/packages/shorebird_cli/test/src/artifact_builder_test.dart @@ -877,7 +877,7 @@ Either run `flutter pub get` manually, or follow the steps in ${cannotRunInVSCod }); }); - group('with error message in stderr', () { + group('with error message in stderr (Xcode <= 15.x)', () { setUp(() { when(() => buildProcessResult.exitCode) .thenReturn(ExitCode.success.code); @@ -908,6 +908,47 @@ error: exportArchive: No signing certificate "iOS Distribution" found''', 'message', ''' Failed to build: + Communication with Apple failed + No signing certificate "iOS Distribution" found + Team "My Team" does not have permission to create "iOS App Store" provisioning profiles. + No profiles for 'com.example.co' were found''', + ), + ), + ); + }); + }); + + group('with error message in stderr (Xcode >= 16.x)', () { + setUp(() { + when(() => buildProcessResult.exitCode) + .thenReturn(ExitCode.success.code); + when(() => buildProcessResult.stderr).thenReturn( + ''' +Encountered error while creating the IPA: +error: exportArchive Communication with Apple failed +error: exportArchive No signing certificate "iOS Distribution" found +error: exportArchive Communication with Apple failed +error: exportArchive No signing certificate "iOS Distribution" found +error: exportArchive Team "My Team" does not have permission to create "iOS App Store" provisioning profiles. +error: exportArchive No profiles for 'com.example.co' were found +error: exportArchive Communication with Apple failed +error: exportArchive No signing certificate "iOS Distribution" found +error: exportArchive Communication with Apple failed +error: exportArchive No signing certificate "iOS Distribution" found +error: exportArchive Communication with Apple failed +error: exportArchive No signing certificate "iOS Distribution" found''', + ); + }); + + test('throws ArtifactBuildException with error message', () { + expect( + () => runWithOverrides(() => builder.buildIpa(codesign: false)), + throwsA( + isA().having( + (e) => e.message, + 'message', + ''' +Failed to build: Communication with Apple failed No signing certificate "iOS Distribution" found Team "My Team" does not have permission to create "iOS App Store" provisioning profiles.