leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
910 stars 142 forks source link

I cannot build the iOS Test app with CI/CD, always throw Provisioning profile issue #2430

Closed radyhaggag closed 1 day ago

radyhaggag commented 3 days ago

Steps to reproduce

I created a profile for the test target one for development and one for app-store, and all of them failed to build iOS app to use it with firebase test lab.

I'm using fastlane and GitHub Actions, and i used fastlane match to create the profiles.

Actual results

Always get the following error:

/Users/runner/work/taaly-staging2/taaly-staging2/ios/Runner.xcodeproj: error: Provisioning profile "match Development com.language.taaly.RunnerUITests" has app ID "com.language.taaly.RunnerUITests", which does not match the bundle ID "com.language.taaly.RunnerUITests.xctrunner". (in target 'RunnerUITests' from project 'Runner')

And i don't know what is "com.language.taaly.RunnerUITests.xctrunner" bundle-id.

How can i solve this?

Logs

Logs ``` [23:26:43]: All required keys, certificates and provisioning profiles are installed 🙌 [23:26:43]: Setting Provisioning Profile type to 'development' [23:26:43]: -------------------------------------------------------------------- [23:26:43]: Step: patrol build ios --target integration_test/integration_test.dart --flavor staging --dart-define=ENVIRONMENT=staging --bundle-id=com.language.taaly.test --release -v [23:27:34]: ▸ #6 PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:366:18) [23:27:34]: ▸ [23:27:34]: ▸ #7 PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:310:18) [23:27:34]: ▸ [23:27:34]: ▸ #8 patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:71:20) [23:27:34]: ▸ [23:27:34]: ▸ #9 main (file:///Users/runner/.pub-cache/hosted/pub.dev/patrol_cli-3.4.0/bin/main.dart:6:20) [23:27:34]: ▸ [23:27:34]: ▸ See the logs above to learn what happened. Also consider running with --verbose. If the logs still aren't useful, then it's a bug - please report it. [23:27:34]: ▸ Error: xcodebuild exited with code 70 [23:27:34]: ▸ #0 throwToolExit (package:patrol_cli/src/base/exceptions.dart:7:3) [23:27:34]: ▸ #1 IOSTestBackend.build. (package:patrol_cli/src/ios/ios_test_backend.dart:141:9) [23:27:34]: ▸ [23:27:34]: ▸ #2 DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:46:7) [23:27:34]: ▸ [23:27:34]: ▸ #3 IOSTestBackend.build (package:patrol_cli/src/ios/ios_test_backend.dart:80:5) [23:27:34]: ▸ [23:27:34]: ▸ #4 BuildIOSCommand.run (package:patrol_cli/src/commands/build_ios.dart:164:7) [23:27:34]: ▸ [23:27:34]: ▸ #5 CommandRunner.runCommand (package:args/command_runner.dart:212:13) [23:27:34]: ▸ [23:27:34]: ▸ #6 PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:366:18) [23:27:34]: ▸ [23:27:34]: ▸ #7 PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:310:18) [23:27:34]: ▸ [23:27:34]: ▸ #8 patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:71:20) [23:27:34]: ▸ [23:27:34]: ▸ #9 main (file:///Users/runner/.pub-cache/hosted/pub.dev/patrol_cli-3.4.0/bin/main.dart:6:20) [23:27:34]: ▸ +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Lane Context | +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | DEFAULT_PLATFORM | ios | | PLATFORM_NAME | ios | | LANE_NAME | ios sync_code_for_dev_test_runner_and_build_tests | | KEYCHAIN_PATH | ~/Library/Keychains/fastlane_tmp_keychain | | ORIGINAL_DEFAULT_KEYCHAIN | "/Users/runner/Library/Keychains/login.keychain-db" | | SIGH_PROFILE_TYPE | development | | MATCH_PROVISIONING_PROFILE_MAPPING | {"com.language.taaly.test"=>"match AppStore com.language.taaly.test", "com.language.taaly.test.taalynotifications"=>"match AppStore com.language.taaly.test.taalynotifications", "com.language.taaly"=>"match AppStore com.language.taaly", "com.language.taaly.taalynotifications"=>"match AppStore com.language.taaly.taalynotifications", "com.language.taaly.RunnerUITests"=>"match Development com.language.taaly.RunnerUITests"} | +------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ [23:27:34]: Called from Fastfile at line 122 [23:27:34]: ``` [23:27:34]: 120: ) [23:27:34]: 121: [23:27:34]: => 122: sh "patrol build ios --target integration_test/integration_test.dart --flavor staging --dart-define=ENVIRONMENT=staging --bundle-id=com.language.taaly.test --release -v" [23:27:34]: 123: end [23:27:34]: 124: end [23:27:34]: ``` [23:27:34]: Exit status of command 'patrol build ios --target integration_test/integration_test.dart --flavor staging --dart-define=ENVIRONMENT=staging --bundle-id=com.language.taaly.test --release -v' was 1 instead of 0. ```

Patrol version

patrol: ^3.13.0-dev.4

Patrol Doctor output

Patrol Doctor output ``` patrol doctor Patrol doctor: Patrol CLI version: 3.4.0 Flutter command: flutter Flutter 3.24.5 • channel stable Android: • Program adb found in /Users/radyhaggag/Library/Android/sdk/platform-tools/adb • Env var $ANDROID_HOME set to /Users/radyhaggag/Library/Android/sdk iOS / macOS: • Program xcodebuild found in /usr/bin/xcodebuild • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller```

Flutter Doctor output

Flutter Doctor output ``` patrol doctor --verbose Verbose mode enabled. More logs will be printed. Patrol doctor: Patrol CLI version: 3.4.0 Flutter command: flutter Flutter 3.24.5 • channel stable Android: • Program adb found in /Users/radyhaggag/Library/Android/sdk/platform-tools/adb • Env var $ANDROID_HOME set to /Users/radyhaggag/Library/Android/sdk iOS / macOS: • Program xcodebuild found in /usr/bin/xcodebuild • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller```
radyhaggag commented 3 days ago

/Users/runner/work/taaly-staging2/taaly-staging2/ios/Runner.xcodeproj: error: Provisioning profile "match Development com.language.taaly.RunnerUITests" has app ID "com.language.taaly.RunnerUITests", which does not match the bundle ID "com.language.taaly.RunnerUITests.xctrunner". (in target 'RunnerUITests' from project 'Runner')

radyhaggag commented 3 days ago

I noted that there are some old issues here related to this problem.

But it closed and they suggested to enable automatic code signing.

But i need it with ci/cd and fastlane & github actions.

Kendru98 commented 1 day ago

Hi @radyhaggag, there is closed issue, with some explanation and (hope so) solution for your problem https://github.com/leancodepl/patrol/issues/1596#issuecomment-1663978628. Let us know if you solved the problem and if you have any questions, cheers.

radyhaggag commented 1 day ago

Hi @Kendru98, I solved it by selecting a profile with "xctrunner" suffix, and set the bundle-id without the "xctrunner".

Kendru98 commented 1 day ago

Great, I will close the issue then. Don't hesitate to create any other issues or features ideas in the future ^^, Cheers Kendru