# Failed to apply code sign settings for target

**URL:** <https://discuss.bitrise.io/t/failed-to-apply-code-sign-settings-for-target/13426>\
**Category:** Builds\
**Tags:** ios-auto-provision\
**Created:** [June 22, 2020, 9:12am UTC](https://discuss.bitrise.io/t/failed-to-apply-code-sign-settings-for-target/13426 "2020-06-22T09:12:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![palusa](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/palusa/32/3026_2.png) [@palusa](https://discuss.bitrise.io/u/palusa)\
**Post date:** [June 22, 2020, 9:12am UTC](https://discuss.bitrise.io/t/failed-to-apply-code-sign-settings-for-target/13426/1 "2020-06-22T09:12:57Z")

</div>

# Failed to apply code sign settings for target

## Description of the issue

When changing the Bundle ID of a project from the Bitrise workflow, the provisioning fails.  
The step used to change the bundle ID (CFBundleIdentifier) is called “Set iOS Info.plist - Bundle Identifier”. Then during the step “iOS Auto Provision with App Store Connect API” i’m calling a scheme that uses the new bundle ID that i also did set using the previous step.

There is both a development and a app-store provisioning profile with this bundle id uploaded to Bitrise.

## Environment:

**Where did the issue happen?**

Bitrise stack: Xcode 11.3.x, on macOS 10.14.6 (Mojave)

**Which build Step causes the issue and which version of the step?**

ios-auto-provision-appstoreconnect: Apply Bitrise managed codesigning on the project

## 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](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _Does the issue happen sporadically, or every time?_ : Every time
- _Does upgrading the build Step to the latest version help?_ : NO

## Build log

```
+------------------------------------------------------------------------------+

| (9) ios-auto-provision-appstoreconnect@0 |
+------------------------------------------------------------------------------+
| id: ios-auto-provision-appstoreconnect |
| version: 0.1.0 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2020-06-22T07:44:28Z |
+------------------------------------------------------------------------------+
| |
Config:
- BuildAPIToken: [REDACTED]
- BuildURL: https://app.bitrise.io/build/94ce2f189b7b3e9f
- ProjectPath: Marginalen.xcodeproj
- Scheme: Marginalen Test
- Configuration: 
- Distribution: app-store
- MinProfileDaysValid: 0
- CertificateURLList: [REDACTED]
- CertificatePassphraseList: 
- KeychainPath: /Users/vagrant/Library/Keychains/login.keychain
- KeychainPassword: *****
- VerboseLog: false
Creating AppstoreConnectAPI client
the client created for https://api.appstoreconnect.apple.com/
Analyzing project
configuration: Release
project team ID: Z3E54ZE449
bundle IDs:
- se.marginalen.test2020
platform: iOS
Downloading certificates
2 certificates downloaded:
- Apple Distribution: Marginalen Bank Bankaktiebolag (Z3E54ZE449)
- Apple Development: Giovanni Palusa (Z65SZU7A62)
ensuring codesigning files for distribution types: [app-store development]
Checking if 1 Bitrise test device(s) are registered on Developer Portal
13 devices are registered on Developer Portal
checking if the device (00008030-001120141104802E) is registered
device already registered
Checking app-store provisioning profiles for 1 bundle id(s)
  Checking bundle id: se.marginalen.test2020
  capabilities: map[keychain-access-groups:[]]
  Bitrise managed profile found: Bitrise iOS app-store - (se.marginalen.test2020)
  the profile is not in sync with the project requirements, regenerating ...
  Searching for app ID for bundle ID: se.marginalen.test2020
  app ID found: Marginalen 2020 Test
  app ID capabilities are in sync with the project capabilities
  Creating profile for bundle id: Marginalen 2020 Test
  profile created: Bitrise iOS app-store - (se.marginalen.test2020)
Checking development provisioning profiles for 1 bundle id(s)
  Checking bundle id: se.marginalen.test2020
  capabilities: map[keychain-access-groups:[]]
  Bitrise managed profile found: Bitrise iOS development - (se.marginalen.test2020)
  the profile is not in sync with the project requirements, regenerating ...
  Searching for app ID for bundle ID: se.marginalen.test2020
  app ID found: Marginalen 2020 Test
  app ID capabilities are in sync with the project capabilities
  Creating profile for bundle id: Marginalen 2020 Test
  profile created: Bitrise iOS development - (se.marginalen.test2020)
Apply Bitrise managed codesigning on the project
  Target: Marginalen Test
  development Team: Marginalen Bank Bankaktiebolag(Z3E54ZE449)
  provisioning Profile: Bitrise iOS development - (se.marginalen.test2020)
  certificate: Apple Development: Giovanni Palusa (Z65SZU7A62)
Failed to apply code sign settings for target (Marginalen Test): failed to change code signing in target attributes, error: failed to get traget's (AC9F4B18249A5C1000D4FCAC) attributes, error: key: string("AC9F4B18249A5C1000D4FCAC") not found in: serialized.Object(serialized.Object{"AC452652221FE5820015522A":map[string]interface {}{"CreatedOnToolsVersion":"10.1", "LastSwiftMigration":"1020"}, "AC452666221FE5860015522A":map[string]interface {}{"CreatedOnToolsVersion":"10.1", "LastSwiftMigration":"1020", "TestTargetID":"AC452652221FE5820015522A"}, "AC452671221FE5860015522A":map[string]interface {}{"CreatedOnToolsVersion":"10.1", "LastSwiftMigration":"1020", "TestTargetID":"AC452652221FE5820015522A"}})
| |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision-appstoreconnect@0 (exit code: 1) | 48.86 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...se-steplib/steps-ios-auto-provision-appstoreconnect/issues |
| Source: ...thub.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect |
+---+---------------------------------------------------------------+----------+
```

---

<div class="post-metadata">

**Author:** ![kylebrowning](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/kylebrowning/32/2589_2.png) [@kylebrowning](https://discuss.bitrise.io/u/kylebrowning)\
**Post date:** [July 15, 2020, 5:56pm UTC](https://discuss.bitrise.io/t/failed-to-apply-code-sign-settings-for-target/13426/2 "2020-07-15T17:56:15Z")

</div>

Did you ever figure this out?

---

<div class="post-metadata">

**Author:** ![palusa](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/palusa/32/3026_2.png) [@palusa](https://discuss.bitrise.io/u/palusa)\
**Post date:** [July 17, 2020, 8:19am UTC](https://discuss.bitrise.io/t/failed-to-apply-code-sign-settings-for-target/13426/3 "2020-07-17T08:19:14Z")

</div>

Unfortunately not… ☹

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [August 16, 2020, 8:19am UTC](https://discuss.bitrise.io/t/failed-to-apply-code-sign-settings-for-target/13426/4 "2020-08-16T08:19:15Z")

</div>

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