Xcode archive & export step fails for flutter even though certificates and profiles are installed with fastlane

Description of the issue

I have a Flutter project which has iOS(apart from android) project files autogenerated and the project is commited in our repository.

I am able to build Android apk from bitrise using the modified deploy pipeline(I have replaced Certificate installer step with fastlane match script for iOS signing) after connecting the repo. For iOS I am facing the issue in Xcode archive and export step.

Environment:

Where did the issue happen?

I have started with Flutter bitrise stack and replaced Certificate and profile installer step with script which installs fastlane and then development certificates

bundle install
bundle exec fastlane match appstore

This succeeds though with warning

Installing certificateā€¦

security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.

[12:29:29]: There are no local code signing identities found.

ā€¦

All required keys, certificates and provisioning profiles are installed :raised_hands:

Build step happens without any error

$ flutter ā€œbuildā€ ā€œiosā€ ā€œā€“debugā€ ā€œā€“no-codesignā€
ā€¦
Running Xcode buildā€¦
Xcode build done. 37.6s
Built /Users/vagrant/git/build/ios/iphoneos/Runner.app.

***Step that causes the issue

But during xcode archive and export step I am getting this error

$ set -o pipefail && xcodebuild ā€œ-workspaceā€ ā€œ/Users/vagrant/git/ios/Runner.xcworkspaceā€ ā€œ-schemeā€ ā€œRunnerā€ ā€œ-configurationā€ ā€œDebugā€ ā€œCOMPILER_INDEX_STORE_ENABLE=NOā€ ā€œarchiveā€ ā€œ-archivePathā€ ā€œ/[redacted]/Runner.xcarchiveā€ | xcpretty
:x: error: Signing for ā€œRunnerā€ requires a development team. Select a development team in the Signing & Capabilities editor. (in target ā€˜Runnerā€™ from project ā€˜Runnerā€™)

Also I can see that it is not detecting team ID in this same step

Configs:

  • ExportMethod: development
  • UploadBitcode: true
  • CompileBitcode: true
  • ICloudContainerEnvironment:
  • TeamID:
  • UseDeprecatedExport: false
  • ForceTeamID:

I am not able to understand what is causing app signing error, even after having installed certificates using fastlane. This happens with both debug and release workflow(I am installing correct version of certificates in the fastlane for the respective workflow). I have attached build logs. Any help would be appreciated.

P.S: We have apple developer account connected to bitrise. Also all the iOS files are generated through Flutter Android studio on Windows and at no point did we use MacOS/Xcode.

Things that did not work

Config:
-IOSAdditionalParams: --debug
-AndroidAdditionalParams: --release
-Platform: ios
-IOSExportPattern: build/ios/iphoneos/.app
build/ios/iphoneos/.ipa
-AndroidOutputType: apk
-AndroidExportPattern: build/app/outputs/apk//.apk
build/app/outputs/bundle//
.aab
-IOSCodesignIdentity:
-ProjectLocation: /Users/vagrant/git
-DebugMode: false
-AndroidBundleExportPattern: build/app/outputs/bundle//*.aab

iOS Codesign settings
Installed codesign identities:
-Apple Development: [our team info]
Stored Flutter codesign settings:
-No codesign identity set

Build iOS
$ flutter ā€œbuildā€ ā€œiosā€ ā€œā€“debugā€
Building [our appid] for device (ios)ā€¦
Signing iOS app for device deployment using developer identity: ā€œApple Development: [our team id]ā€
Running Xcode buildā€¦
Xcode build done. 2.9s
Failed to build iOS app
Error output from Xcode build:
ā†³
** BUILD FAILED **
Xcodeā€™s output:
ā†³
note: Using new build systemnote: Planning buildnote: Constructing build descriptionerror: There are no accounts registered with Xcode. Add your developer account to Xcode (in target ā€˜Runnerā€™ from project ā€˜Runnerā€™)error: No profiles for [our appid] were found: Xcode couldnā€™t find any iOS App Development provisioning profiles matching [our appid]. (in target ā€˜Runnerā€™ from project ā€˜Runnerā€™)

Reproducibility

  • Does a ā€œRebuildā€ help? (You can trigger a rebuild from the Buildā€™s page, by clicking the ā€œRebuildā€ button in the top right corner of a finished build) : /NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : /NO
  • Does the issue happen sporadically, or every time? :

Build log

Debug workflow log:

ā€œBitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automationā€

Release workflow log:

ā€œBitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automationā€

Hi @scorz!

Really sorry about the long delay on this one. Few small things Iā€™d like to point out, like fastlane is installed by default so we only recommend installing it if you need a specific version other than the available one. Also, we have a community based Fastlane Match step that might work better here.

Either way, Iā€™d recommend removing the Certificate and Profile Installer step if you use fastlane match. If this all fails too, weā€™d like you try using the Certificate and Profile Installer step and upload your identities to Bitrise, so we can tell whether this problem is related to the third-party tool in question or our service.

Hopefully this helps!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.